Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66694

Re: Units of Global parameter value

$
0
0

For further reference, since I couldn't find any good explanations how to convert the internal value to project units and vice versa, I found this way through the Revit API:

 

gp_type = GlobalParameter.GetDefinition().UnitType

display_units = doc.GetUnits().GetFormatOptions(gp_type).DisplayUnits

 

gp_type returns the UnitType of this global parameter (lenght, area, volume etc.)

display_units returns the DisplayUnitType to which Revit converts the internal value for displaying in the user interface.

 

Then I could use the UnitUtils class to convert between internal and project value (display_unit), irrespective of which unit the user has set in the project units dialog and which UnitType the global parameter has.


Viewing all articles
Browse latest Browse all 66694

Trending Articles