Skip to content
Get on GitHub Autodesk App Store - coming soon

Navisworks: Units

4 nodes. Types ending in [] are lists. An input with a default is optional.

Units.All

Every unit name accepted by Units.Convert and Units.ScaleFactor.

No inputs.

Outputs

Output Type What it gives
names string[] The valid unit names (e.g. "Meters", "Feet", "Millimeters").

Tags: units all names list valid

Units.Convert

Converts a length, an area or a volume from one unit to another (e.g. Feet to Millimeters). Set dimension to Area for square units (square feet to square meters) or Volume for cubic units; the default, Length, converts a length as before.

Inputs

Input Type Default What it does
value required number — The value to convert.
fromUnits required Units — Source units (e.g. "Feet").
toUnits required Units — Target units (e.g. "Millimeters").
dimension string "Length" Length (default), Area or Volume: what the value measures. An area is converted with the length factor squared, a volume with it cubed.

Outputs

Output Type What it gives
value number The converted value.

Tags: units convert length conversion area volume square cubic

Units.Current

The display units of a document (all API lengths, areas and volumes use them), read again on every run. The same text is the units output of Document.Info.

Inputs

Input Type Default What it does
document Document null The document (defaults to the active document).

Outputs

Output Type What it gives
units string The unit name, e.g. "Meters" or "Feet".

Tags: units current document meters feet

Units.ScaleFactor

The multiplier that converts a length, an area or a volume from one unit to another. With dimension Length (the default) it is the factor for lengths; Area gives that factor squared and Volume cubed, which is what quantities such as the areas and volumes from Model.Statistics or takeoffs need (square feet to square meters is the length factor squared).

Inputs

Input Type Default What it does
fromUnits required Units — Source units (e.g. "Feet"); unit names as in Units.Current.
toUnits required Units — Target units (e.g. "Millimeters").
dimension string "Length" Length (default), Area or Volume: an area factor is the length factor squared, a volume factor is it cubed.

Outputs

Output Type What it gives
factor number The scale factor (multiply a source value by it).

Tags: units scale factor conversion area volume square cubic