Revit unit type to display units

Hello there,

I am trying to obtain the units used in Revit project automatically and save it in an excel file. I am using a python code to retrieve the desired unit type but they are displayed as RevitAPI unit type.

Is it possible to wrapp them again and output them as Revit display units.
for example, instead of DUT_METERS, “m” or “meters”.

I have tried ToDSType(bool) but it is not working.

Thank you in advance

use DisplayUnitType and UnitUtils instead

http://www.revitapidocs.com/2019/7d3d3306-a4c2-c577-0aeb-cca42d6cfd2f.htm
http://www.revitapidocs.com/2019/128dd879-fea8-5d7b-1eb2-d64f87753990.htm

They will still appear as DUT_METERS for example. I want to appear as Meters, as displayed in Revit.

I am not looking to find an element dimensions. I want to output the active Revit units which the user identify at the beginning of the modeling.
image

or like this
image

If you want to know more then please contact me at my Github --> https://github.com/erfajo/OrchidForDynamo

message no…1

hey… did you find solution to this problem?
I am trying to set Project Units in the beginning of a project Using Dynamo. kindly reply!

Hey there, Yes I guess I did find a soultion. I haved used LabelUtils.GetlabelFor() method. I honestly do not remember how did I find this solution but it works and displays the units as they appear in Revit interface.

I am attaching the python code. I guess you can choose other units to display or call all the list or sth but what is important to you is the line nr. 37

Best of luck!

1 Like

Great help! :heart_eyes:
Thankyou so much!

1 Like