formatLength writes a length in metres as dimension text. formatScale writes a drawing scale as a label such as 1:50.
Import
Example
Notes
- The metric default is millimetres with no decimals. The imperial default is feet and inches, to 1/16 inch.
- A viewport at 1:50 has
scale: 1 / 50. - A scale that is zero, negative or not a number gives
NTS. - A length that is not a finite number gives an empty string.
formatScale
The scale label for a sheet or a viewport.formatLength
Format a model length for a dimension label.defaultLengthFormat
The default format for a unit system — what a dimension gets when unstyled.Types
LengthFormat
UnitSystem
required
LengthDisplay
Defaults to
mm for metric and ft-in for imperial.number
Metric: decimal places. Imperial
ft-in/in: the fraction denominator to round to (2, 4, 8, 16,
32 or 64). Defaults to 0 metric, 16 imperial.boolean
Print the unit after the value (“3000 mm”). Imperial always marks its units.
string
string