# How to Enable "Editin3DViews" via python module code

**URL:** <https://discourse.slicer.org/t/how-to-enable-editin3dviews-via-python-module-code/5706>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [February 8, 2019, 9:59pm UTC](https://discourse.slicer.org/t/how-to-enable-editin3dviews-via-python-module-code/5706 "2019-02-08T21:59:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolsocks](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/coolsocks/32/3299_2.png) [@coolsocks](https://discourse.slicer.org/u/coolsocks)\
**Post date:** [February 8, 2019, 9:59pm UTC](https://discourse.slicer.org/t/how-to-enable-editin3dviews-via-python-module-code/5706/1 "2019-02-08T21:59:17Z")

</div>

Hi I’m new to slicer development and I wanted to update my code to the 4.10 version. I just had a question of how to enable the “edit in 3D view” section using the qMRMLSegmentEditorWidget?

I got to this point:  
self.segmentEditorWidget.setActiveEffectByName(“Erase”)  
effect = self.segmentEditorWidget.activeEffect()  
effect.setParameter(“Editin3DViews”,“1”)  
effect.self().onApply()  
But whenever I attempt to erase, it will only rotate/displace the volume.

Thanks

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [February 8, 2019, 10:25pm UTC](https://discourse.slicer.org/t/how-to-enable-editin3dviews-via-python-module-code/5706/2 "2019-02-08T22:25:32Z")

</div>

Hi Amanda,

I see you have posted this twice in less than an hour. Please, keep it contained to one post and someone on the forum will respond to you likely within the day.

> [@Enable "Edit in 3D View" Via qMRMLSegmentEditorWidget](https://discourse.slicer.org/t/enable-edit-in-3d-view-via-qmrmlsegmenteditorwidget/5701/2):
>
> I got to this point: self.segmentEditorWidget.setActiveEffectByName(“Erase”) effect = self.segmentEditorWidget.activeEffect() effect.setParameter(“Editin3DViews”,“1”) effect.self().onApply() But whenever I attempt to erase, it will only rotate/displace the volume.

---

<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:** [February 8, 2019, 11:06pm UTC](https://discourse.slicer.org/t/how-to-enable-editin3dviews-via-python-module-code/5706/3 "2019-02-08T23:06:26Z")

</div>

Parameter names are case sensitive (`EditIn3DViews` is correct, `Editin3DViews` is incorrect). Also, this parameter is shared between paint and erase effects, therefore you need to set it using `setCommonParameter`.

So, you need to change

```
effect.setParameter("Editin3DViews","1")

```

to

```
effect.setCommonParameter("EditIn3DViews","1")
```

---

<div class="post-metadata">

**Author:** ![coolsocks](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/coolsocks/32/3299_2.png) [@coolsocks](https://discourse.slicer.org/u/coolsocks)\
**Post date:** [February 9, 2019, 7:12am UTC](https://discourse.slicer.org/t/how-to-enable-editin3dviews-via-python-module-code/5706/4 "2019-02-09T07:12:07Z")

</div>

Sorry about that, will keep that in mind for next time
