# Change active markup list (open curve) from another module, and control-click to add new points

**URL:** <https://discourse.slicer.org/t/change-active-markup-list-open-curve-from-another-module-and-control-click-to-add-new-points/8785>\
**Category:** Development\
**Created:** [October 15, 2019, 9:37pm UTC](https://discourse.slicer.org/t/change-active-markup-list-open-curve-from-another-module-and-control-click-to-add-new-points/8785 "2019-10-15T21:37:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [October 15, 2019, 9:37pm UTC](https://discourse.slicer.org/t/change-active-markup-list-open-curve-from-another-module-and-control-click-to-add-new-points/8785/1 "2019-10-15T21:37:47Z")

</div>

Hello, I have several objects whose visualizations in Slicer are represented by the new Open Curve markups. From my module, I would like to be able to select which Open Curve is currently active and click to add new points to that currently active curve by clicking on the slice views (or 3D view). I can currently achieve this in a roundabout way by switching to the Markups module, selecting the curve node in the List selector at the top, then clicking the “Create and Place Open Curve” button along the top. I want to be able achieve this without changing away from my module. I found `slicer.modules.markups.logic().SetActiveListID()`, but I haven’t been able to make this work. The corresponding `GetActiveListID()` function returns a MRML id string like ‘vtkMRMLMarkupsCurveNode24’ but supplying a string like that to `SetActiveListID` in the python interactor fails with error  
`Traceback (most recent call last):`  
` File "<console>", line 1, in <module>`  
`TypeError: SetActiveListID argument 1: method requires a VTK object`

Supplying a curve node as the argument does not throw an error, but also doesn’t seem to change the active list.

----- EDIT BELOW—

OK, I just discovered that actually supplying a curve node DOES seem to change the active list, but the change is not reflected in the GUI view. I suspect I need a call to something like updateGuiFromMRML() somewhere, but I can’t find how to do that call. I’ll keep looking, but if someone knows how to do that, I would be appreciative.

---

<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:** [October 17, 2019, 4:56am UTC](https://discourse.slicer.org/t/change-active-markup-list-open-curve-from-another-module-and-control-click-to-add-new-points/8785/3 "2019-10-17T04:56:48Z")

</div>

These examples probably do what you need: [https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Switching\_to\_markup\_fiducial\_placement\_mode](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Switching_to_markup_fiducial_placement_mode)

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [October 20, 2019, 3:45am UTC](https://discourse.slicer.org/t/change-active-markup-list-open-curve-from-another-module-and-control-click-to-add-new-points/8785/4 "2019-10-20T03:45:05Z")

</div>

Thank you. These are helpful references. I am still not sure why the Markups module GUI view is not updated when I set the active list ID, but it’s not actually very important for my purposes, so I am no longer pursuing it. I appreciate the help, thanks!
