Skip to content

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.

let model = await SketchUpApi.getActiveModel();
let { LengthUnit } = SketchUpApi;
let units = model.options.unitOptions;
console.log(units.lengthUnit);
// => 0 (Inches)
// Change to meters
await units.update({ LengthUnit: LengthUnit.Meter });
let updated = await units.refresh();
console.log(updated.lengthUnit);
// => 4 (Meter)

UnitOptions for reading and updating the active unit