What is HOOPS default unit ?
By default, all units in HOOPS Exchange and PRC files are stored as multiples of mm.
For example, a meter will correspond to a value of 1000 while an inch is represented by 25.4
How can I determine a model’s global unit ?
It’s possible to have multiple different units used inside of a same model, so that’s why each product occurrence can have its own unit (see A3DAsmProductOccurrenceData::m_dUnit).
In order to find the one global to the whole model, you’ll need to browse trough its POs and find the first one for which A3DAsmProductOccurrenceData::m_bUnitFromCAD is set to true.
That’s basically what the function A3DAsmModelFileGetUnit (introduced since HE 2019) does.
Note |
---|
Be careful because the model unit found may look slightly different from what is rendered if a scale is also set inside of the A3DTopoContextData. |
How can I overwrite units inside a PRC file ?
So the easiest and fastest way to change the default unit in a model is to edit the root PO (by using A3DAsmProductOccurrenceEdit for example), set m_bUnitFromCAD to true and put the desired m_dUnit (defined as a mm multiple)To learn more about units and to get the answer to this question, check out our forum post.