# Paring a needle model with a vtktransform through python code

**URL:** <https://discourse.slicer.org/t/paring-a-needle-model-with-a-vtktransform-through-python-code/2827>\
**Category:** Support\
**Created:** [May 16, 2018, 3:52pm UTC](https://discourse.slicer.org/t/paring-a-needle-model-with-a-vtktransform-through-python-code/2827 "2018-05-16T15:52:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lgroves](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@lgroves](https://discourse.slicer.org/u/lgroves)\
**Post date:** [May 16, 2018, 3:52pm UTC](https://discourse.slicer.org/t/paring-a-needle-model-with-a-vtktransform-through-python-code/2827/1 "2018-05-16T15:52:30Z")

</div>

I am trying to pair an already existing needle model with tracking data streaming in through the Plus server to view the needle in the 3D view. Currently I am performing this through using the data module and dragging my needle model on top of the appropriate transform, however I would like to code this to happen automatically as part of my module.

Any help is appreciated!

Thanks 🙂

---

<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:** [May 16, 2018, 8:15pm UTC](https://discourse.slicer.org/t/paring-a-needle-model-with-a-vtktransform-through-python-code/2827/2 "2018-05-16T20:15:09Z")

</div>

You can call `transformableNode.SetAndObserveTransformNodeID(transformNode.GetID())`. See more examples in [Transforms module documentation](https://www.slicer.org/wiki/Documentation/Nightly/Modules/Transforms#Examples).
