# How to fix the value unit in python?

**URL:** <https://forum.dynamobim.com/t/how-to-fix-the-value-unit-in-python/71089>\
**Category:** Revit\
**Tags:** python\
**Created:** [December 5, 2021, 9:41am UTC](https://forum.dynamobim.com/t/how-to-fix-the-value-unit-in-python/71089 "2021-12-05T09:41:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![A.C](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@A.C](https://forum.dynamobim.com/u/A.C)\
**Post date:** [December 5, 2021, 9:41am UTC](https://forum.dynamobim.com/t/how-to-fix-the-value-unit-in-python/71089/1 "2021-12-05T09:41:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/0/a077c727e0e6f3e9ed028faa6cf281c4a1b5f751.png)  
I set the value in python script. But the value displayed in revit properties is not the same as I inputed in python script.

I also try to use Element.SetParameterByName. The value displayed in revit properties is the same as what I feed to the node.

So how I can fix this problem in python script.

---

<div class="post-metadata">

**Author:** ![Daniel\_Woodcock1](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@Daniel\_Woodcock1](https://forum.dynamobim.com/u/Daniel_Woodcock1)\
**Post date:** [December 5, 2021, 12:31pm UTC](https://forum.dynamobim.com/t/how-to-fix-the-value-unit-in-python/71089/2 "2021-12-05T12:31:31Z")

</div>

It’s hard to say without seeing your code, but a common issue is due to revits internal units being imperial and passing in metric values without first converting to imperial. When you set a value via the API it must be in imperial.

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [December 6, 2021, 11:05am UTC](https://forum.dynamobim.com/t/how-to-fix-the-value-unit-in-python/71089/3 "2021-12-06T11:05:26Z")

</div>

@A.C  
in addition to @Daniel_Woodcock1’s answer Dynamo nodes (OOTB), uses by default the units of the Revit project
