# Interaction handles disappear if markup node becomes invisible

**URL:** https://discourse.slicer.org/t/interaction-handles-disappear-if-markup-node-becomes-invisible/14492
**Category:** Development
**Created:** [November 8, 2020, 6:18pm UTC](https://discourse.slicer.org/t/interaction-handles-disappear-if-markup-node-becomes-invisible/14492 "2020-11-08T18:18:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)
#### Post date: [November 8, 2020, 6:18pm UTC](https://discourse.slicer.org/t/interaction-handles-disappear-if-markup-node-becomes-invisible/14492/1 "2020-11-08T18:18:51Z")

</div>

The objetive was to translate and rotate a model using the interaction handles. To do this I was recommended that I do the translation/rotation using the interaction handles to a plane and then to get it’s PointModifiedEvent connected to a UpdateTransform function that uses GetPlaneToWorldMatrix method to set up the linear transform node I apply to the model. Like it says here:

> [@Interaction Handle for one Fiducial connected to a Model](https://discourse.slicer.org/t/interaction-handle-for-one-fiducial-connected-to-a-model/14483/2):
>
> We’ll add a transform widget that will support the features that you describe, probably within a few months. Until then, I would recommend to use a markups plane node to specify position/orientation using the interaction handles (you can hide the plane itself). You can get the transform corresponding to the position/orientation of the plane using [GetPlaneToWorldMatrix](https://apidocs.slicer.org/master/classvtkMRMLMarkupsPlaneNode.html#aee11e275c748479d7a7232f36e291563) method.

I was able to make the model rotate and translate with the plane’s interaction handles:

> A = slicer.mrmlScene.AddNewNodeByClass(“vtkMRMLMarkupsPlaneNode”, “Plane”)  
> A.SetOrigin([0,0,-150])  
> A.SetNormal([0,0,1])  
> A.SetAxes([100,0,0],[0,100,0],[0,0,100])  
> A.SetAxes([100,0,0],[0,100,0],[0,0,100])
> 
> def UpdateTransform(param1=None, param2=None):  
> #You have to create a linear transform called LinearTransform\_3 in the Transforms module  
> transformFid = slicer.mrmlScene.GetFirstNodeByName(‘LinearTransform\_3’)  
> matrixScrew = vtk.vtkMatrix4x4()  
> A.GetPlaneToWorldMatrix(matrixScrew)  
> transformFid.SetMatrixTransformToParent(matrixScrew)  
> transformFid.UpdateScene(slicer.mrmlScene)
> 
> A.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent,UpdateTransform)
> 
> #Turn on the interaction handles  
> B = getFirstNodeByClassByName(“vtkMRMLMarkupsDisplayNode”,‘MarkupsDisplay’)  
> B.SetHandlesInteractive(True)

But the interaction handles disappear if set up the plane invisible like I was suggested above. I expected the interaction handles remained there so I can move the model.

> B.SetVisibility(False)

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [November 8, 2020, 6:36pm UTC](https://discourse.slicer.org/t/interaction-handles-disappear-if-markup-node-becomes-invisible/14492/2 "2020-11-08T18:36:07Z")

</div>

`SetVisibility` controls visibility of all parts of the markups in all views. If you just want to hide the plane itself then you can set fill and outline opacity to 0.0.
