The Unit enum tells about the available metric unit available in the API.
All geometric values inside the DMU are expressed as DMU units.
The DMU Unit is available through :
/** * Sample to explain of units are handled in 3djuump Infinite (Unit). */ import { Unit, DataSessionInterface } from'generated_files/documentation/appinfiniteapi';
// the DataSessionInterface has been created previously and is connected letlDataSession : DataSessionInterface; // the `geometric instance id` to query constlGeometricId : number = 128; // get the DMU build unit constlDMUUnit : Unit = lDataSession.getDmuBuildUnit(); // we want to output values in mm constlConvertFactor : number = lDataSession.convertUnitFactor(lDMUUnit, Unit.U_Millimeter); // the size of the sphere the geometry can be included into constlMaxSizeOfGeometry : number = Math.sqrt(lDataSession.getGeometricOBBDiagonalSquaredLength(lGeometricId)); // convert to mm constlMaxSizeOfGeometryInMillimeters : number = lConvertFactor * lMaxSizeOfGeometry; // and output its value console.log('this geometry can be included in a sphere of diameter :' + lMaxSizeOfGeometryInMillimeters.toString() + ' millimeters');
The Unit enum tells about the available metric unit available in the API.
All geometric values inside the DMU are expressed as DMU units.
The DMU Unit is available through :
Usual units are available.
See