Ho to Getting the model object properties in the right display units

58 Views Asked by At

Do we have any way to convert from autodesk.unit.unit:millimeters-1.0.1 to symbol mm without javascript library.

My problem is i'm wrting library in c# and python, and I want to show symbol unit of properties from model.

I saw this post but still same issue :

Forge Viewer: How to use Units?

In a forge web app, trying to get the unit's old short name from the new Revit 2021 units

Any help is appreciated !

1

There are 1 best solutions below

0
Adam Nagy On

We're looking into a generic solution, but in the meantime, you could come up with some code based on the forgeUnitToSymbol() function from https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.js

enter image description here

You could also store the contents of FORGE_UNITS used in that function. Based on some code comments it sounds like that content does not change often.