# Print the point's RAS in real time

**URL:** <https://discourse.slicer.org/t/print-the-points-ras-in-real-time/28449>\
**Category:** Development\
**Tags:** python\
**Created:** [March 19, 2023, 12:08pm UTC](https://discourse.slicer.org/t/print-the-points-ras-in-real-time/28449 "2023-03-19T12:08:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slicer365](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slicer365/32/67549_2.png) [@slicer365](https://discourse.slicer.org/u/slicer365)\
**Post date:** [March 19, 2023, 12:08pm UTC](https://discourse.slicer.org/t/print-the-points-ras-in-real-time/28449/1 "2023-03-19T12:08:53Z")

</div>

I creat a point F, I want to print the point’s RAS position in python console，in real-time，when I move it.

Anyone can tell me how to write the script?

I write it as like this，it doesn’t work:

```auto
F_Node=getNode('F')

def printRAS(Node，Event=None):
      print(Node.GetNthFiducialPosition(0, position))

Tag = F_Node.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, printRAS)

```

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [March 19, 2023, 4:59pm UTC](https://discourse.slicer.org/t/print-the-points-ras-in-real-time/28449/2 "2023-03-19T16:59:55Z")

</div>

If you try calling your `printRAS` function with the node as a parameter you can see `position` is not defined. Also if you do use `help(F_node.GetNthFiducialPosition)` you can see that `GetNthFiducialPosition` is deprecated and you should use `GetNthControlPointPosition` instead.

So the better code would be:

```auto
def printRAS(Node, Event=None):
    print(Node.GetNthControlPointPosition(0))

F_Node.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, printRAS)
```
