# Select locked control points in markup

**URL:** https://discourse.slicer.org/t/select-locked-control-points-in-markup/30221
**Category:** Development
**Tags:** markups
**Created:** [June 21, 2023, 1:56am UTC](https://discourse.slicer.org/t/select-locked-control-points-in-markup/30221 "2023-06-21T01:56:36Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [June 21, 2023, 1:56am UTC](https://discourse.slicer.org/t/select-locked-control-points-in-markup/30221/1 "2023-06-21T01:56:36Z")

</div>

Yes the problem is solved but there is another problem now.

The user will click any of the control point. Before the user selects any control point the model position is moved to get the location to select the control point. In doing so the control points can get selected and moved from their original position.

I do not want the control points to move while the user is moving the model to locate the location on the model for which it will select the control points on the model.

Is there a way to lock and still select the control points so its position doesn’t move while moving the model.

thanks

regards,  
saima

---

<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: [June 25, 2023, 12:17pm UTC](https://discourse.slicer.org/t/select-locked-control-points-in-markup/30221/2 "2023-06-25T12:17:04Z")

</div>

You can interact with a markup control point if you keep the node unlocked.

If you want to lock the _position_ of control points by locking them. If you lock every control point but not lock the node then you can interact with any control point but cannot accidentally move it.

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [July 11, 2023, 2:34am UTC](https://discourse.slicer.org/t/select-locked-control-points-in-markup/30221/3 "2023-07-11T02:34:29Z")

</div>

Hi Andras,  
Could you please refer me to the code snippet to lock the control points rather then the markupnode?

regards,  
Saima

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [July 11, 2023, 7:58am UTC](https://discourse.slicer.org/t/select-locked-control-points-in-markup/30221/4 "2023-07-11T07:58:32Z")

</div>

markupnode.SetNthControlPointLocked(fid\_no, True)

got this.

thanks

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [July 11, 2023, 8:02am UTC](https://discourse.slicer.org/t/select-locked-control-points-in-markup/30221/5 "2023-07-11T08:02:14Z")

</div>

once the control points are locked as they are created. are they still locked when loading them in another application.

regards,  
Saima

---

<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 11, 2023, 1:40pm UTC](https://discourse.slicer.org/t/select-locked-control-points-in-markup/30221/6 "2023-07-11T13:40:59Z")

</div>

I’m not sure why you are asking this and what other application you mean. I would recommend to try it and if the behavior is not what you need then try to solve it. If you need help with that (e.g., you cannot solve by yourself within a half day) then you can ask here for help. You need to describ your high-level goal, and specifically what you did, what you expected to happen, and what happened instead.

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [July 13, 2023, 5:29am UTC](https://discourse.slicer.org/t/select-locked-control-points-in-markup/30221/7 "2023-07-13T05:29:45Z")

</div>

Hi Andras,  
I created control pointsand locked them as they are created. When I reopen these control points there state of being locked remain unchanged which I wanted.

Thanks

regards,  
Saima

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [July 13, 2023, 1:41pm UTC](https://discourse.slicer.org/t/select-locked-control-points-in-markup/30221/8 "2023-07-13T13:41:31Z")

</div>

They would remain locked when you reload them:

1. If you saved them as JSON (I am not sure the legacy fcsv supports locked states)
2. reload them into Slicer (we cannot be sure what other applications would do).
