LengthUnit
The unit of measurement for lengths displayed in the model.
SketchUp always stores geometry in inches internally, but displays measurements to the user in whichever unit they’ve chosen in Model Info > Units. Read the current setting from UnitOptions.lengthUnit, or change it via UnitOptions.update.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let { LengthUnit } = SketchUpApi;let units = model.options.unitOptions;console.log(units.lengthUnit);// => 0 (Inches)
// Change to metersawait units.update({ LengthUnit: LengthUnit.Meter });let updated = await units.refresh();console.log(updated.lengthUnit);// => 4 (Meter)UnitOptions for reading and updating the active unit
Enumeration Members
Section titled “Enumeration Members”Centimeter
Section titled “Centimeter”Centimeter:
3
Feet:
1
Inches
Section titled “Inches”Inches:
0
Meter:
4
Millimeter
Section titled “Millimeter”Millimeter:
2
Yard:
5