# Manipulate model visibility

**URL:** <https://discourse.slicer.org/t/manipulate-model-visibility/13921>\
**Category:** Development\
**Tags:** python, 3d-model\
**Created:** [October 7, 2020, 2:44pm UTC](https://discourse.slicer.org/t/manipulate-model-visibility/13921 "2020-10-07T14:44:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aldoSanchez](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@aldoSanchez](https://discourse.slicer.org/u/aldoSanchez)\
**Post date:** [October 7, 2020, 2:44pm UTC](https://discourse.slicer.org/t/manipulate-model-visibility/13921/1 "2020-10-07T14:44:03Z")

</div>

I want to manipulate the module created from the segmentation.  
what i did was to export the segmentation to modules  
and now I want to manipulate the colors and the visibility of the modules.  
here’s the code:

```python
#export segmentation
segmentationNode=getNode(‘Segmentation’)
modelHierarchyNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLModelHierarchyNode')
slicer.modules.segmentations.logic().ExportVisibleSegmentsToModelHierarchy(segmentationNode, modelHierarchyNode)

```

---

<div class="post-metadata">

**Author:** ![aldoSanchez](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@aldoSanchez](https://discourse.slicer.org/u/aldoSanchez)\
**Post date:** [October 7, 2020, 4:43pm UTC](https://discourse.slicer.org/t/manipulate-model-visibility/13921/2 "2020-10-07T16:43:55Z")

</div>

I found out the following way to manipulate the model:

```python
vtkLWM=getNode('Left-Cerebral-White-Matter')
vtkLWM.SetDisplayVisibility(False)

```
