Skip to content

LengthFormat

How length measurements are formatted for display.

Controls the notation style used when showing lengths in dimensions, the tape measure, and the Value Control Box. Read the current format from UnitOptions.lengthFormat, or change it via UnitOptions.update.

let model = await SketchUpApi.getActiveModel();
let { LengthFormat } = SketchUpApi;
let units = model.options.unitOptions;
console.log(units.lengthFormat);
// => 0 (Decimal)
// Switch to feet-and-inches notation
await units.update({
LengthFormat: LengthFormat.Architectural,
});
let updated = await units.refresh();
console.log(updated.lengthFormat);
// => 1 (Architectural)

UnitOptions for reading and updating the active format

Architectural: 1

Feet and fractional inches, like 3' 6 1/2".


Decimal: 0

Decimal notation, like 3.5" or 0.089 m.


Engineering: 2

Feet and decimal inches, like 3' 6.5".


Fractional: 3

Whole number with fractional remainder, like 3 1/2".