Skip to content

VolumeUnit

The unit of measurement for volumes displayed in the model.

SketchUp always computes volumes in cubic inches internally, but displays them in whichever unit the user has chosen in Model Info > Units. Read the current setting from UnitOptions.volumeUnit, or change it via UnitOptions.update.

let model = await SketchUpApi.getActiveModel();
let { VolumeUnit } = SketchUpApi;
let units = model.options.unitOptions;
console.log(units.volumeUnit);
// => 5 (CubicYard)
// Change to cubic meters
await units.update({ VolumeUnit: VolumeUnit.CubicMeter });
let updated = await units.refresh();
console.log(updated.volumeUnit);
// => 4 (CubicMeter)

UnitOptions for reading and updating the active unit

CubicCentimeter: 3


CubicFeet: 1


CubicInches: 0


CubicMeter: 4


CubicMillimeter: 2


CubicYard: 5


Liter: 6


USGallon: 7