# Dynamo python units

**URL:** <https://forum.dynamobim.com/t/dynamo-python-units/22628>\
**Category:** Revit\
**Tags:** units\
**Created:** [June 8, 2018, 10:48am UTC](https://forum.dynamobim.com/t/dynamo-python-units/22628 "2018-06-08T10:48:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![b.fedonin](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@b.fedonin](https://forum.dynamobim.com/u/b.fedonin)\
**Post date:** [June 8, 2018, 10:48am UTC](https://forum.dynamobim.com/t/dynamo-python-units/22628/1 "2018-06-08T10:48:52Z")

</div>

Hello ! I’ve always created family instances with the nodes, but now i need to do it with Python.  
As a point to create instance i define Point = XYZ(0,50,0). I thought it would be 50 millimeters, but turns out - it feets. How can i convert units inside a script? (apart from dividing it by 304.8)  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![m.ravelli](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@m.ravelli](https://forum.dynamobim.com/u/m.ravelli)\
**Post date:** [June 8, 2018, 12:01pm UTC](https://forum.dynamobim.com/t/dynamo-python-units/22628/2 "2018-06-08T12:01:53Z")

</div>

If you don’t like to convert every single coordinate, you can try to define a function in python ([https://www.programiz.com/python-programming/function](https://www.programiz.com/python-programming/function)):

input = Point (in millimeters) ------\> output = Point (in feets)

---

<div class="post-metadata">

**Author:** ![b.fedonin](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@b.fedonin](https://forum.dynamobim.com/u/b.fedonin)\
**Post date:** [June 8, 2018, 12:03pm UTC](https://forum.dynamobim.com/t/dynamo-python-units/22628/3 "2018-06-08T12:03:41Z")

</div>

Hello. Well yes, i had this thoughts, but there will be a LOT of coordinates) I thought maybe it can be declared somehow as the script starts…

---

<div class="post-metadata">

**Author:** ![HossZamani](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosszamani/32/43041_2.png) [@HossZamani](https://forum.dynamobim.com/u/HossZamani)\
**Post date:** [June 8, 2018, 12:25pm UTC](https://forum.dynamobim.com/t/dynamo-python-units/22628/4 "2018-06-08T12:25:33Z")

</div>

> **[DynamoDS/Dynamo](https://github.com/DynamoDS/Dynamo/wiki/Python-0.6.3-to-0.7.x-Migration#units)**
>
> Open Source Graphical Programming for Design. Contribute to DynamoDS/Dynamo development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![b.fedonin](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@b.fedonin](https://forum.dynamobim.com/u/b.fedonin)\
**Post date:** [June 8, 2018, 12:38pm UTC](https://forum.dynamobim.com/t/dynamo-python-units/22628/5 "2018-06-08T12:38:29Z")

</div>

Thank you! I will try it

---

<div class="post-metadata">

**Author:** ![b.fedonin](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@b.fedonin](https://forum.dynamobim.com/u/b.fedonin)\
**Post date:** [June 8, 2018, 1:39pm UTC](https://forum.dynamobim.com/t/dynamo-python-units/22628/7 "2018-06-08T13:39:30Z")

</div>

Thank you! It might be the solution. I will try to go with DUT\_MILLIMETERS
