# Help with orientation marker and ruler

**URL:** https://discourse.slicer.org/t/help-with-orientation-marker-and-ruler/13454
**Category:** Support
**Created:** [September 11, 2020, 11:53pm UTC](https://discourse.slicer.org/t/help-with-orientation-marker-and-ruler/13454 "2020-09-11T23:53:24Z")
**Posts on this page:** 6
**Page:** 2

<div class="post-metadata">

### Author: ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)
#### Post date: [April 16, 2021, 7:01pm UTC](https://discourse.slicer.org/t/help-with-orientation-marker-and-ruler/13454/21 "2021-04-16T19:01:13Z")

</div>

I don’t know if this is exactly what you need but here is code I used to make the user draw a line:

```auto
lineNode = slicer.mrmlScene.CreateNodeByClass("vtkMRMLMarkupsLineNode")
lineNode.SetName("temp")
slicer.mrmlScene.AddNode(lineNode)
slicer.modules.markups.logic().AddNewDisplayNodeForMarkupsNode(lineNode)
lineNode.SetName(slicer.mrmlScene.GetUniqueNameByString("line"))

#setup placement
slicer.modules.markups.logic().SetActiveListID(lineNode)
interactionNode = slicer.mrmlScene.GetNodeByID("vtkMRMLInteractionNodeSingleton")
interactionNode.SwitchToSinglePlaceMode()

```

---

<div class="post-metadata">

### Author: ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)
#### Post date: [April 16, 2021, 8:00pm UTC](https://discourse.slicer.org/t/help-with-orientation-marker-and-ruler/13454/22 "2021-04-16T20:00:48Z")

</div>

Hey @mau_igna_06, I owe you big time! This is perfect! Wow! Made my day!

🙂

---

<div class="post-metadata">

### Author: ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)
#### Post date: [April 21, 2021, 4:48pm UTC](https://discourse.slicer.org/t/help-with-orientation-marker-and-ruler/13454/23 "2021-04-21T16:48:54Z")

</div>

How does one delete the lines using Python?

---

<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: [April 21, 2021, 5:09pm UTC](https://discourse.slicer.org/t/help-with-orientation-marker-and-ruler/13454/24 "2021-04-21T17:09:10Z")

</div>

`slicer.mrmlScene.RemoveNode(lineNode)` to remove

---

<div class="post-metadata">

### Author: ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)
#### Post date: [April 21, 2021, 7:38pm UTC](https://discourse.slicer.org/t/help-with-orientation-marker-and-ruler/13454/25 "2021-04-21T19:38:52Z")

</div>

Is there a Slicer Python Scripting reference manual that I can use so that I can stop bugging you guys about every little command? Thanks! 🙂

---

<div class="post-metadata">

### Author: ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)
#### Post date: [April 21, 2021, 7:55pm UTC](https://discourse.slicer.org/t/help-with-orientation-marker-and-ruler/13454/26 "2021-04-21T19:55:56Z")

</div>

The Python [script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository) is a good place to start.

[Previous page](https://discourse.slicer.org/t/help-with-orientation-marker-and-ruler/13454.md?page=1)
