# How to change translation from global to Local with python code?

**URL:** <https://discourse.slicer.org/t/how-to-change-translation-from-global-to-local-with-python-code/5559>\
**Category:** Support\
**Created:** [January 29, 2019, 2:25pm UTC](https://discourse.slicer.org/t/how-to-change-translation-from-global-to-local-with-python-code/5559 "2019-01-29T14:25:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [January 29, 2019, 2:25pm UTC](https://discourse.slicer.org/t/how-to-change-translation-from-global-to-local-with-python-code/5559/1 "2019-01-29T14:25:24Z")

</div>

I can create a transform and set translation on local manually. But are there any code could change translation from global to Local with python code?  
I checked github code found: `setCoordinateReference(LOCAL)`, while a error happen as follows:  
‘vTransformr.setCoordinateReference(LOCAL)  
Traceback (most recent call last):  
File “”, line 1, in   
AttributeError: ‘vtkCommonTransformsPython.vtkTransform’ object has no attribute 'setCoordinateReference’

---

<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:** [January 30, 2019, 1:53am UTC](https://discourse.slicer.org/t/how-to-change-translation-from-global-to-local-with-python-code/5559/4 "2019-01-30T01:53:19Z")

</div>

2 posts were merged into an existing topic: [How to switch transform from global to local](https://discourse.slicer.org/t/how-to-switch-transform-from-global-to-local/5539)

---

<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:** [January 30, 2019, 1:53am UTC](https://discourse.slicer.org/t/how-to-change-translation-from-global-to-local-with-python-code/5559/5 "2019-01-30T01:53:20Z")

</div>


