A3DAsmModelFileGetUnit
-
A3DStatus
A3DAsmModelFileGetUnit(const A3DAsmModelFile *pModelFile, A3DDouble *pdUnit) Retrieves the unit a model file should be displayed with.
12.0Return Values
A3D_SUCCESS: if
pModelFileis zero or if a unit is found.A3D_INITIALIZE_NOT_CALLED: if the library is not initialized.
A3D_INVALID_DATA_NULL: if
pdUnitis zero whilepModelFileis nonzero.A3D_ERROR: if no unit is found.
Behavior
When
A3DAsmModelFileGetUnitfinds a suitable unit in the provided model file,pdUnitis filled with a floating-point decimal representation of this unit, as stated inembed:rst:inline :doc:`/guide/units`
.
pdUnitcan then be converted intoA3DEUnitsusingA3DUnitGetFromEnum().The unit of an entire model file depends on the value of the
m_bUnitFromCADfield, either inA3DAsmModelFileDataorA3DAsmProductOccurrenceData.A3DAsmModelFileGetUnitrecursively traverses the model file given bypModelFileand stops on the first entity (model file or product occurrence) wherem_bUnitFromCADis A3D_TRUE. Them_dUnitfield of this entity is then written inpdUnit.- If
pdUnitis 0, the function returnsA3D_INVALID_DATA_NULL - If
pModelFileis 0, the function returnsA3D_SUCCESSand*pdUnitis set to 0.0.
The traversal may complete without finding any unit. In this case, the function returns
A3D_ERROR.Memory Management
The caller is reponsible from the memory pointed to by
pdUnit.embed:rst:inline :doc:`/guide/units`
Parameters
pModelFile: A handle to a model file entity
pdUnit: A location to an A3DDouble
Returns
A3D_SUCCESSon success, or an error code on failure- If