placeDrawing puts a drawing in metres into a viewport on the page, in millimetres. The viewport sets the scale, the rotation and the aim. It can also set the paper size of the plan text with labelMm.
Import
Example
Notes
labelMmis a text height in paper millimetres, 1.8 or more. Room names and tags print at it at every scale. Room detail lines print at 0.7 of it, but never under 1.8 mm.- A viewport’s
labelMmwins over thelabelMmof its saved plan view, in that viewport only. - Markers and level labels keep their own size.
- A project with a viewport
labelMmunder 1.8 does not open; the error names the path.
placeDrawing
Place a viewport’sVectorDrawing (model metres) into its frame (paper mm).
viewportTransform
The model→paper point transform for a viewport: model metres centred in theframe at viewport.scale, then turned by viewport.rotationDeg, counter-clockwise on the sheet.
inverseViewportTransform
Inverse of viewportTransform: map a paper-mm point back to model metres for the same viewport.fitTransform
Compute the stage transform that fits a page into a viewport, centred.fitViewportScale
The scale and aim that fit a drawing inside a frame, snapped to a real scale.viewCenterOf
The model point that lands at the centre of the viewport’s frame.viewportExtent
The box, in model metres, that a viewport atscale is fitted and centred on: the drawing’s bounds, grown to hold each paper-sized symbol (a door or window tag) at the size it prints at that scale, and without the site parts when centerOn is 'building'.
viewSourceToDrawingRequest
Map a viewport’sViewSource to a core DrawingRequest.
modelToPaper
Model length (metres) → paper length (millimetres) at a drawing scale.Types
DrawingExtent
What the viewport centre and fit read from a drawing: its bounds and, when it has them, its primitives.SheetPolicy
Resolved once per sheet (and again per viewport that names its own style).Style ids,
extends, hatch keys and colours that could not be resolved. Warned once per sheet;
the render falls back rather than failing.PlacedDrawing
A viewport’s drawing mapped into paper space (mm), ready to emit. The package does not export this type by name.Clip rectangle (the viewport frame) when
viewport.clip is set.With
clip: the paper box of each view-mark head (a paper-sized MARKER symbol, such as a
section bubble) that reaches out of the frame. The clip holds these boxes too, so a mark at the
edge of the crop prints whole; the model ink stays cut at the frame. Absent when every head is
inside the frame.