Enumeration Unit

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
let lDataSession : DataSessionInterface;
// the `geometric instance id` to query
const lGeometricId : number = 128;
// get the DMU build unit
const lDMUUnit : Unit = lDataSession.getDmuBuildUnit();
// we want to output values in mm
const lConvertFactor : number = lDataSession.convertUnitFactor(lDMUUnit, Unit.U_Millimeter);
// the size of the sphere the geometry can be included into
const lMaxSizeOfGeometry : number = Math.sqrt(lDataSession.getGeometricOBBDiagonalSquaredLength(lGeometricId));
// convert to mm
const lMaxSizeOfGeometryInMillimeters : number = lConvertFactor * lMaxSizeOfGeometry;
// and output its value
console.log('this geometry can be included in a sphere of diameter :' + lMaxSizeOfGeometryInMillimeters.toString() + ' millimeters');

Usual units are available.
Metadata

Enumeration Members

U_Centimeter: 1

Unit in centimeters.

U_Decimeter: 2

Unit in decimeters.

U_Foot: 5

Unit in feet. A foot is 304,8 millimeters.

U_Inch: 4

Unit in inches. An inch is 25,4 millimeters.

U_Invalid: -1

Invalid unit.

U_Meter: 3

Unit in meters.

U_Millimeter: 0

Unit in millimeters.