# Changing View Group of a Node in View Controllers using Python

**URL:** <https://discourse.slicer.org/t/changing-view-group-of-a-node-in-view-controllers-using-python/3450>\
**Category:** Support\
**Tags:** python, views\
**Created:** [July 10, 2018, 6:04pm UTC](https://discourse.slicer.org/t/changing-view-group-of-a-node-in-view-controllers-using-python/3450 "2018-07-10T18:04:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cphillips](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cphillips](https://discourse.slicer.org/u/cphillips)\
**Post date:** [July 10, 2018, 6:04pm UTC](https://discourse.slicer.org/t/changing-view-group-of-a-node-in-view-controllers-using-python/3450/1 "2018-07-10T18:04:30Z")

</div>

I want to change the view group of a bunch of different nodes in the View Controllers module as part of a Python script.

So far I have only managed to get that vc = slicer.modules.viewcontrollers gives me access to the View Controllers module, but am unsure how to change the view group (which is under View Controllers --\> Advanced)

---

<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:** [July 10, 2018, 8:34pm UTC](https://discourse.slicer.org/t/changing-view-group-of-a-node-in-view-controllers-using-python/3450/2 "2018-07-10T20:34:38Z")

</div>

Most properties you can modify directly in the MRML node. For example, you can set the `Red` slice view node group to `1` by this call:

```
slicer.app.layoutManager().sliceWidget('Red').mrmlSliceNode().SetViewGroup(1)
```
