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.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let { VolumeUnit } = SketchUpApi;let units = model.options.unitOptions;console.log(units.volumeUnit);// => 5 (CubicYard)
// Change to cubic metersawait units.update({ VolumeUnit: VolumeUnit.CubicMeter });let updated = await units.refresh();console.log(updated.volumeUnit);// => 4 (CubicMeter)UnitOptions for reading and updating the active unit
Enumeration Members
Section titled “Enumeration Members”CubicCentimeter
Section titled “CubicCentimeter”CubicCentimeter:
3
CubicFeet
Section titled “CubicFeet”CubicFeet:
1
CubicInches
Section titled “CubicInches”CubicInches:
0
CubicMeter
Section titled “CubicMeter”CubicMeter:
4
CubicMillimeter
Section titled “CubicMillimeter”CubicMillimeter:
2
CubicYard
Section titled “CubicYard”CubicYard:
5
Liter:
6
USGallon
Section titled “USGallon”USGallon:
7