# How to draw a simple line with vtkMRMLMarkupsLineNode?

**URL:** https://discourse.slicer.org/t/how-to-draw-a-simple-line-with-vtkmrmlmarkupslinenode/18820
**Category:** Development
**Tags:** python, markups
**Created:** [July 20, 2021, 1:04pm UTC](https://discourse.slicer.org/t/how-to-draw-a-simple-line-with-vtkmrmlmarkupslinenode/18820 "2021-07-20T13:04:43Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Guillaume](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@Guillaume](https://discourse.slicer.org/u/Guillaume)
#### Post date: [July 20, 2021, 1:04pm UTC](https://discourse.slicer.org/t/how-to-draw-a-simple-line-with-vtkmrmlmarkupslinenode/18820/1 "2021-07-20T13:04:44Z")

</div>

Hello,  
I have not found how to make a simple line going from point P1 to point P2. with vtkMRMLMarkupsLineNode … I’m still on Slicer 4.11.  
Could you help me?  
Thank you !!

---

<div class="post-metadata">

### Author: ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)
#### Post date: [July 20, 2021, 2:23pm UTC](https://discourse.slicer.org/t/how-to-draw-a-simple-line-with-vtkmrmlmarkupslinenode/18820/2 "2021-07-20T14:23:42Z")

</div>

Something like

```auto
# Create line node
line = slicer.mrmlScene.AddNewNodeByClass( 'vtkMRMLMarkupsLineNode', 'TestLine')
# First point
pBegin = vtk.vtkVector3d( 0, 0, 0)
# Second point
pEnd = vtk.vtkVector3d( 100, 100, 100)
# Add points
line.AddControlPointWorld(pBegin)
line.AddControlPointWorld(pEnd)

```

---

<div class="post-metadata">

### Author: ![Guillaume](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@Guillaume](https://discourse.slicer.org/u/Guillaume)
#### Post date: [July 20, 2021, 2:45pm UTC](https://discourse.slicer.org/t/how-to-draw-a-simple-line-with-vtkmrmlmarkupslinenode/18820/3 "2021-07-20T14:45:48Z")

</div>

Thank you for your help.  
But, it doesn’t work … The row doesn’t even append in the data.

---

<div class="post-metadata">

### Author: ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)
#### Post date: [July 20, 2021, 2:58pm UTC](https://discourse.slicer.org/t/how-to-draw-a-simple-line-with-vtkmrmlmarkupslinenode/18820/4 "2021-07-20T14:58:54Z")

</div>

I have tested with version [4.11](https://download.slicer.org/) from site page and it works without problems, and node is shown in subject hierarchy correctly.

---

<div class="post-metadata">

### Author: ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)
#### Post date: [July 20, 2021, 3:10pm UTC](https://discourse.slicer.org/t/how-to-draw-a-simple-line-with-vtkmrmlmarkupslinenode/18820/5 "2021-07-20T15:10:46Z")

</div>

Make sure that every line of code is executed correctly.

---

<div class="post-metadata">

### Author: ![Guillaume](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@Guillaume](https://discourse.slicer.org/u/Guillaume)
#### Post date: [July 20, 2021, 3:19pm UTC](https://discourse.slicer.org/t/how-to-draw-a-simple-line-with-vtkmrmlmarkupslinenode/18820/6 "2021-07-20T15:19:33Z")

</div>

yesss… 😭 I find the problème… I totally forgot to call the function… Sorry 😭 And thank you !
