Skip to main content
These functions make the dimension annotations of a drawing. overallDimensions gives the full width and the full height. The other functions give a string of dimensions along an edge or a facade.

Import

Example

Notes

  • Model points are in metres. Offsets and text sizes are in paper millimetres.
  • The dimensions keep the points that the drawing had at the time of the call. Make them again after the model changes.
  • Replace the old annotations when you make new ones. This prevents duplicate ids.

overallDimensions

Overall width + height measures from the drawing’s real model extents (its bounds).

chainDimensions

An exterior dimension chain along one edge of the drawing — the running string of measurements an issued plan carries outside its façade, breaking at each wall junction and each opening jamb.

facadeDimensions

One dimension string per exterior run, offset to the OUTSIDE of the plan.

facadeDimensionExtent

The outermost paper offset facadeDimensions will use, so a caller can place the overall dimension beyond it.

facadeRuns

The straight runs of exterior wall, each with the stations a dimension string breaks at.

Types

MeasureOptions

The package does not export this type by name.
number
required
Perpendicular offset of the dimension line, in paper mm.
number
required
Label height, in paper mm.
number
Decimal places on the millimetre value. Default 0.
string

MeasureAnnotation

A viewport-linked dimension: from/to are saved points in the viewport’s model space (metres).
string
required
"measure"
required
string
Named style in PaperDocument.dimensionStyles. Absent uses the default.
string
required
Viewport whose drawing + transform resolve this dimension.
Point2
required
Point2
required
number
required
Perpendicular offset of the dimension line, in paper mm.
number
required
Label height, in paper mm.
number
Decimal places on the measured mm value. Default 0.
string
Optional label override; default = measured model distance in mm.

ChainOptions

The package does not export this type by name.
ChainEdge
required
The edge the chain runs along.
number
Depth searched inward from that edge, in metres. Only geometry reaching into this band contributes a breakpoint, so a chain measures the façade it sits against rather than every wall on the floor. Default 1.0 — one band comfortably deeper than the thickest wall in the Swiss Dwellings sample (0.91 m).
number
Breakpoints closer together than this (metres) are one breakpoint. Default 0.02.
number
A link shorter than this (metres) is dropped, folding into its neighbour: a 2 cm jamb return is a construction detail, not a dimension. Default 0.05 — deliberately BELOW the kernel’s 0.10 m minimum wall, so every wall the model can express still earns its own dimension. Raise it past 0.10 and a chain silently swallows every partition, which is how a dimensioned drawing loses its partitions.

DimensionableStorey

The package does not export this type by name.
DimensionableWall[]
DimensionableSpace[]
Rooms, used to confirm a wall really is on the façade — see outerSideIsOpen.

FacadeDimensionOptions

The package does not export this type by name.
number
Ignore runs shorter than this, in metres. Default 0.6 — a doorway. A 1.5 m floor dropped s24485-w6, a 1225 mm façade WITH a window in it.
(dropped: FacadeDropped) => void
Called for every façade left undimensioned, so a caller can report it rather than let it vanish.
[ string, string ]
Which pset flags an exterior wall.

FacadeDropped

Why a façade was not dimensioned. The package does not export this type by name.

FacadeRun

The package does not export this type by name.
string
The wall this run belongs to.
Point2
required
Run ends in drawing space — BmWall points are world XZ and the drawing maps {x, y: z}.
Point2
required
number
required
True length along the run, in metres.
number[]
required
Ascending stations along the run, always beginning at 0 and ending at length.
number
required
How many openings put jambs on this run.
number
required
The wall’s thickness, so a caller can clear the dimension line off the FACE rather than the centreline — otherwise clearance shrinks as walls get thicker.

ChainEdge

Which edge of the drawing a dimension chain runs along. The package does not export this type by name.

DimensionableWall

The package does not export this type by name.
string
Array<[ number, number ]> | Point2[]
required
boolean
A closed wall’s last segment runs from the final point back to the first.
number
required
DimensionableOpening[]
Record<string, Record<string, unknown>>

DimensionableSpace

The package does not export this type by name.
{ outerRing?: Array<[ number, number ]> | Point2[]; }
string
Room type, if known. An OUTDOOR type behind a wall does not make it internal.
Record<string, Record<string, unknown>>

DimensionableOpening

The subset of BmStorey this needs. The package does not export this type by name.
number
required
number
required
CLEAR opening, between the frames — not the hole in the wall.
number
Frame on each side. The structural opening is width + 2 * frameWidth. ABSENT IS NOT ZERO: the kernel cuts the void at frameWidth ?? DEFAULT_FRAME_WIDTH (0.05), so treating an absent frame as 0 reproduces exactly the 100 mm error this module was fixed for — just on documents that do not spell the frame out.
Last modified on October 11, 2026