# How to show VR in View2/3 by code?

**URL:** <https://discourse.slicer.org/t/how-to-show-vr-in-view2-3-by-code/9671>\
**Category:** Support\
**Created:** [December 31, 2019, 12:14pm UTC](https://discourse.slicer.org/t/how-to-show-vr-in-view2-3-by-code/9671 "2019-12-31T12:14:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![apparrilla](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/apparrilla/32/9230_2.png) [@apparrilla](https://discourse.slicer.org/u/apparrilla)\
**Post date:** [December 31, 2019, 12:14pm UTC](https://discourse.slicer.org/t/how-to-show-vr-in-view2-3-by-code/9671/1 "2019-12-31T12:14:21Z")

</div>

![Anotación 2019-12-31 131150](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/c/dc8129cd1d351658b8e99fa2f4d1fbc4de5fba35.png)

How can I switch on/off volume rendering in secondary views by code?

Thanks!

---

<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:** [December 31, 2019, 1:59pm UTC](https://discourse.slicer.org/t/how-to-show-vr-in-view2-3-by-code/9671/2 "2019-12-31T13:59:46Z")

</div>

You can get the volume rendering display node by calling [GetFirstVolumeRenderingDisplayNode](http://apidocs.slicer.org/master/classvtkSlicerVolumeRenderingLogic.html#aa6f86f51fec274f8a28ea966a1ee3a10) then call its [AddViewNodeID](http://apidocs.slicer.org/master/classvtkMRMLDisplayNode.html#a62cff2549fe8c0c4fbff5b363031e242) method for each view that you want your volume to be displayed in.

---

<div class="post-metadata">

**Author:** ![apparrilla](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/apparrilla/32/9230_2.png) [@apparrilla](https://discourse.slicer.org/u/apparrilla)\
**Post date:** [December 31, 2019, 3:23pm UTC](https://discourse.slicer.org/t/how-to-show-vr-in-view2-3-by-code/9671/3 "2019-12-31T15:23:54Z")

</div>

Super…  
Thanks and happy New year.
