Skip to main content
A paper document holds your sheets. createEmptyDocument makes a new one. validateDocument checks one that you read from storage.

Import

Example

Notes

  • A new document has no sheets.
  • Sheet sizes, margins and positions are in millimetres. The origin is the top-left corner.
  • The document is plain JSON data. Your app owns it.
  • A sheet can hold a northArrow and a scaleBar annotation. Each names a viewport on the same sheet in viewportId, which sets its rotation or its scale.
  • A sheet can hold a legend annotation: a key with one row per entry. The paper style of the viewport in viewportId draws each swatch with the fill, hatch, ink and dash of the element it names. { id: 'key', kind: 'legend', viewportId: 'ground', position: { x: 140, y: 236 }, fontSize: 2.5, title: 'KEY', entries: [{ label: 'New walls', swatch: { ogType: 'WALL', phase: 'new', as: 'region' } }, { label: 'Walls to remove', swatch: { ogType: 'WALL', phase: 'demolished', as: 'line' } }] } draws a key of two rows under KEY.
  • A saved plan view can set openingTags and wallTags ('none' or 'auto', off when absent), labelMm (paper mm, 1.8 or more), hideStairAboveCut, labelClearance ({ markerLines: boolean, gapMm: number }, gapMm 0 or more; off when absent) and roomLabel.minTextMm (paper mm, 1.8 or more). See drawProjectView for what the last two draw.
  • A roof plan view takes siteBoundaryLabel, rooflightTags and openingTagText as a plan view does. { kind: 'roof-plan', id: 'roofs', name: 'Roof plan', buildingId: 'house', showSiteBoundary: true, siteBoundaryLabel: { text: 'Boundary Line', spacingM: 8 }, rooflightTags: 'auto' } repeats Boundary Line along each edge of the red line and writes the labelName of each rooflight beside it. The label draws only with showSiteBoundary; without the fields the roof plan draws as before.
  • A plan view with no storeyId is a site plan: the parcel, the dashed setback line and the mass parts of every building. Put it on a sheet like any plan view.
  • validateDocument refuses a point that is not { x, y }, such as [x, y], a viewCenter that is not a point, a size of 0 or less, and text under 1.8 mm.
  • A project with a bad sheet annotation does not open, and apply refuses it. The ProjectFileError path names the annotation field, and the message gives the value. Its code is one of these:

Native sheet edits

In select mode, double-click text, a leader, or a dimension label to edit it in place. Enter emits one edit-text event with targetId and a replacement annotation; Escape or leaving the input cancels. Delete and Backspace emit one delete event for the selected annotation or viewport. Typing in a field does not delete the selection. The renderer never changes the document. Apply the candidate through ProjectManager.apply with replace-project-item on the sheet; a batch takes only building commands, so apply each changed marker after the sheet as its own replace-project-item. Then call renderer.update(manager.snapshot().paper). Keep dependent viewport annotations and marker targets valid when deleting a viewport. A refused candidate must redraw from the unchanged manager snapshot. The compose-a-sheet example demonstrates this path with Undo and Redo. Move and resize preview on screen. Pointer cancellation or Escape removes the preview without emitting a committed candidate. Text editing supports plain labels; it does not edit rich text or table cells. Resize grips are available for image annotations, rectangle shapes and circle shapes. Their resize event includes a detached replacement annotation in paper millimetres: images retain their source and authored aspect ratio, rectangles retain their authored corner order, and circles retain a circular aspect ratio. Apply this annotation through the same sheet command as a move or text edit, then redraw from the authoritative project snapshot. A refused candidate restores the original geometry and adds no history. Viewport resize continues to provide frame. Text, leaders, dimensions, viewport-linked measures and line/polyline shapes have no resize grips. They remain selectable and retain their supported move, text-edit and Delete actions; resizing their bounding boxes would not define a valid native geometry edit. No model-space anchors or annotation font sizes are scaled by a resize gesture.

Customize title blocks natively

Title-block elements are protected in normal sheet mode. Call renderer.setTitleblockEditing(true) for explicit customization; call it with false when finished. In this mode, native selection and grips move fields, logos, rectangles and divider lines. Fields, images and rectangles can be resized; logo grips preserve the original aspect ratio. Divider lines can be moved or removed. Page pan/zoom and typing-target protection remain available. Escape and pointer cancellation restore a gesture preview without publishing an edit. editTitleblockElement(edit: TitleblockElementEdit) supports these validated commands:
Font size and alignment apply to fields. Updates preserve field bindings and logo aspect ratio. The methods throw on invalid input, unknown IDs or attempts to edit outside customization mode. Each committed native gesture or explicit command emits one edit-titleblock event with template (a detached normalized candidate) and elementId. A select event in this mode provides elementId instead of a viewport/annotation targetId. The renderer owns no template history and never changes the registry. A consumer stores the candidate under a new immutable resource ID before committing its reference through the existing sheet command:
The resource persistence and version-ID functions above belong to the host application. A refused consumer write redraws the unchanged authoritative document. Keep older resource versions so one project undo restores the exact previous template. The compose-a-sheet guide demonstrates native customization with the shared controls, immutable versions, and a JSON-roundtripped project/resource bundle for native SVG/PDF export.

Position drawing contents inside a viewport

Call renderer.setViewportContentEditing(viewportId) to drag the resolved vector drawing within its existing paper frame. The frame, rotation, clipping and scale remain unchanged. The candidate viewCenter is in model metres and uses the native inverse viewport transform. Missing or unresolved vector contents throw before entering the mode; raster contents do not support model-space positioning. Pass undefined to return to ordinary sheet editing. Title-block customization and content positioning are exclusive modes.
Subscribe to project changes and call renderer.update(manager.snapshot().paper) as in the composition recipe. Each completed drag publishes one candidate; the renderer never mutates the document or adds history. Escape, pointer cancellation, tool or mode changes, updates and disposal discard an active preview. The renderer redraws authoritative contents after a candidate callback, including refusal. Frame editing and annotation text/Delete actions stay protected in this mode; paper navigation remains available.

Native paper overflow reports

PaperExporter.preflight(sheetId, options) returns a detached Promise<PaperPreflightReport> without changing the document, fitting a view, shrinking text or changing export output. options.target is required ('pdf' or 'svg'); the optional style has the same precedence as an export call. Use the same document and render dependencies, including frozen resources/date, as the export.
For a ProjectFile, use preflightProjectSheet(project, sheetId, options) to reuse the native project export context: saved/legacy plans, prepared raster resolvers, resources, date and temporary-build disposal. Its required options combine ProjectExportOptions with PaperPreflightOptions; use the same frozen project and export options for preflight and output.
For a PDF subset, materialize the selected sheets into the frozen selectedProject.paper before both calls. This keeps automatic page counts/order consistent: single-sheet preflight uses the supplied document’s page context, while exportProjectPdf counts its selected output. The wrapper does not silently select, reorder or mutate your project. All bounds are in paper millimetres. paperBounds is the physical page, independently of printable margins. items retain annotation IDs, viewport IDs with content/title parts, normalized titleblock element IDs and the frame source. Each item supplies its known conservative bounds when available and coverage: 'complete' | 'partial'. Report bounds unions the known item bounds; it does not include an unknown text extent. Empty layout can have no bounds. Warnings have these codes:
  • outside-paper: conservative layout bounds cross the physical page. This can overestimate actual ink, especially joined strokes and font overhangs; it is guidance about possible cropping, not a pixel-exact ink test.
  • title-overlap: a view title whose style sets textMm or position stands on the drawing of its own or another viewport, or on another view title, as a title can that widened or moved to stay on the paper. The sheet still draws; message names the viewport and bounds is the place of the title’s words, estimated at the width of Paper Mono.
  • unknown-text-metrics: the text cannot be measured under the qualified font contract. PDF measurement currently covers printable ASCII in the embedded Paper Mono face, including native height, alignment, rotation and tracking. Other glyphs/families, including the PDF standard-font fallbacks, remain explicit partial coverage. SVG CSS font metrics are not qualified; nonempty SVG text produces this warning rather than borrowing PDF fallback metrics.
  • missing-resource: the referenced titleblock registry/template is unavailable. Its source retains the template ID; measurement remains partial instead of declaring omitted branding safe.
The report is partial if any item has a measurement gap. No outside-paper warning in a partial report is not a safety verdict. Complete coverage means conservative authored layout is measured, not that arbitrary fonts or exact glyph ink have been established. Image rectangles are conservative layout bounds; this method does not decode or validate image files, perform all export-resource checks, or replace issuance validation. Viewport content bounds are intersected with the box of the native viewport clip (the frame, and each view-mark head that reaches past it); their titles remain outside that clip. North arrows, scale bars, tables, schedules and revision tables are measured from the geometry the export draws. Field rectangles determine placement/alignment rather than text width, so long titleblock values are measured as text. Native annotation/measure/frame/style geometry is reused. SVG-only short-outline suppression stays SVG-only. Existing boundsOfPrimitives retains its analytic-geometry/text-anchor fitting semantics. Stroke bounds follow the native cap/join policy. Round joins use half the stroke width; joined miter outlines use a deliberately wider conservative envelope. Native SVG omits tiny outline stubs while native PDF retains them, so target reports can differ. A missing sheet or unresolved native viewport keeps its existing error behavior. Apply any intended document correction through existing project commands; preflight owns no history or persistence.

Isolating copied paper styles

Set sheet.inheritDocumentStyle = false to resolve that sheet and its viewports from local style inputs instead of the document’s style ID/overlay. Absent or true preserves existing inheritance; non-boolean values are refused at the native sheet field path. With no local/caller style input, the legacy unstyled policy remains unchanged. Capture a copied source’s effective native resolveSheetPolicy(sourceSheet, sourceRenderDeps)?.style as a detached styleOverride, omit its already-resolved styleId/extends, and use the flag on the created native sheet. Omit style fields if source policy is undefined. An isolated partial overlay uses the shipped ISO palette as its implicit base; unrelated destination registry entries cannot replace that implicit default. Explicit local style references still use the native registry, and explicit caller style overrides remain last. Carry resources required by explicit references. The flag persists through native project JSON and existing sheet commands/undo. It changes paper style inheritance only, not unit conventions, dimension-style registries or other destination sheets.

createEmptyDocument

A blank document with no sheets, at the current version.

validateDocument

Structural guard for a deserialized document (validate at the storage boundary).

findSavedView

Look up one saved drawing definition without resolving or drawing it.

UnresolvedSavedViewError

A named view needs a project-level resolver before it can be drawn.

Types

PaperDocument

The serializable paper-space document — the source of truth a consumer stores and syncs (.spec/debt.md “Paper / drawing layer”).
1 | 2
required
From version 2 a viewport’s and a text annotation’s rotationDeg turn counter-clockwise as the sheet is seen. A version 1 document turned them clockwise; it is moved to version 2 when it is drawn or opened in a project (migratePaperRotations), each turn negated so nothing moves.
UnitSystem
Which conventions the whole drawing set follows: millimetre dimensions and 1:50-style scales, or feet-and-inches and 1/4” = 1’-0”. A set is one country’s practice, so this lives on the document rather than per sheet. Absent means "metric", so existing documents are unchanged.
DimensionStyleRegistry
Named dimension styles, keyed by the id an annotation’s styleId names. Absent means every dimension uses DEFAULT_DIMENSION_STYLE.
PaperStyleId
The paper style the whole set is drawn in — a builtin id or one of this document’s own paperStyles.
PaperStyle
An overlay on the style: one class changed without forking the preset. Plain JSON, like everything else here.
PaperStyleRegistry
House styles that travel with the file, resolvable by id. They outrank the builtins and anything a host registers.
Sheet[]
required

Sheet

string
Explicit sheet reference number; independent of the display name.
string
required
string
required
PageSpec
required
Viewport[]
required
Annotation[]
required
TitleblockInstance
SheetRevision[]
The issues of this sheet, oldest first. The title block’s revision field shows the last code; a revisionTable annotation lists them all. Absent means no revision.
boolean
Absent/true inherits document style inputs. False uses local sheet/viewport inputs and explicit caller overrides only.
PaperStyleId
This sheet’s style, outranking the document’s.
PaperStyle
Layered over the document’s overlay unless isolated, then the viewport’s over this.

Viewport

SavedDrawingView

Authored drawing intent.

PaperStyleId

A builtin autocompletes; any other string is a custom (registered) id.

PaperStyle

A style, or the overlay a document/sheet/viewport layers on one.
string
string
string
The preset this layers on. Resolved depth-first with a cycle guard.
{ color?: string; ground?: 'screen' | 'print' | 'both'; }
string
Default stroke colour for every class.
number
Rungs walked on PEN_LADDER_MM for every class.
Partial<Record<NonNullable<DrawingStyle['role']>, Omit<ClassStyle, 'byKind' | 'edgeClasses'>>>
Keyed by the physical role of a section or elevation line (cut, silhouette, projected, hidden, datum, marker, surface, ground, existing-ground): composed after the shipped role pen and before classes. The shipped existing-ground pen is 0.25 mm and dashed.
DepthBand[]
Ladder steps by depth for silhouette and projected lines: the first band whose untilM is at or beyond the line’s depth, in metres from the view plane, adds its ladderStep.
number
The least paper gap, in mm, between two parallel lines of a material pattern on a seen face (DrawingStyle.surfacePattern) at the scale of the viewport. A course closer than this to the last kept course beside it is left out, so a shallow roof seen from its eave keeps every n-th course. Absent leaves every course.
Record<string, ClassStyle>
Keyed by ElementType (WALL, DOOR, SPACECONTAINER, …).
Record<string, ClassStyle>
Composed on top of the class entry for an HLR edge class (Hidden, VisibleCrease); the shipped EDGE_CLASS_MODIFIER is already applied underneath, so these are deltas. visible: false drops the edge class.
Record<string, Pick<ClassStyle, 'ink' | 'weightMm' | 'fill' | 'hatch'>>
Keyed by the material a cut region carries (a wall material such as WOOD, or a model material key): how that material is inked, weighted, filled or hatched. Composed after classes and edgeClasses and before phases, so a phase that sets a fill or a hatch still wins.
Record<string, { weightMm: number; }>
Plan cut outline weights in paper millimetres, keyed by saved wall type id. Each weight is finite and positive.
Partial<Record<NonNullable<DrawingStyle['phase']>, PhaseStyle>>
Composed after classes and edgeClasses on a primitive stamped with that phase.
'allow' | 'ignore'
Whether a producer’s explicit style.fill reaches the paper. "allow" is resolvePen’s behaviour and the default; presets say "ignore". "ignore" also leaves out the colour of the lines of a material pattern. A paper knock-out (fill.paper, the mask under a stair word) reaches it either way.
Typography
AnnotationTextStyle
How a sheet’s text annotations (notes) sit on what they cover. Absent draws them as before, straight over hatches and lines. See AnnotationTextStyle.
ViewTitleStyle
The view titles of the sheet. A view title takes the style of the sheet, not of its viewport.
HandProfile
Hand-drawn linework. Absent means ruled — every CAD preset.

PaperStyleRegistry

PageSpec

PageFormat
required
PageOrientation
required
{ width: number; height: number; }
required
Paper units = millimetres, top-left origin (A4 = 210 × 297).
number
required
Uniform inset from every edge. Still the only inset when frame is absent, which is what keeps existing documents rendering exactly as before.
SheetFrameOptions
The printed drawing frame — border, asymmetric filing margin, centring marks and zone grid (ISO 5457). Absent means no printed frame, and margin alone positions the title block.

Annotation

Sheet annotations, in paper units (mm, top-left origin).

TitleblockInstance

Placement of a title-block template on a sheet, with values bound to the template’s named fields (.spec/debt.md “Paper / drawing layer”).
string
required
Record<string, string>
required
Values bound by name to the template’s fields.

SheetRevision

One issue of a sheet: an id unique on the sheet and a code, both nonblank, a date and a description.
string
required
string
required
string
required
As printed, for example ISO 2026-10-22.
string
required

ViewportBase

A live reference into model space, placed on a sheet. The package does not export this type by name.
'vector' | 'raster'
Saved sections/elevations share one view definition across both outputs.
string
Explicit drawing number belonging to this sheet placement.
string
required
{ x: number; y: number; width: number; height: number; }
required
Placement rect on the sheet, in paper units (mm, top-left origin).
number
required
Dimensionless drawing ratio (paper ÷ real), e.g. 1:50 → 0.02.
string
Registered scale name (NamedScale.id), e.g. “1:50” or “1/4in-1ft”.
number
required
The drawing turned about the centre of frame by this many degrees, counter-clockwise as the sheet is seen, as CAD turns a view (clockwise before PaperDocument version 2).
boolean
required
Point2
The model point (metres) placed at the centre of frame.
'drawing' | 'building'
What the centre and the fit of a viewport without viewCenter are taken from. 'drawing' (the default, and what absent means) is the bounds of the whole drawing. 'building' leaves out the site parts: the plot outline, the owned land, the setback and no-build lines, the ground line, the site labels, the context buildings and the boundary distances of a block plan. Everything else counts, every other label included, so a building off the centre of a long plot is centred in the frame. The centre is read from the drawing at each render, so it follows model edits. A drawing of site parts only is centred as a whole. An explicit viewCenter wins over it.
number
Text height in paper mm for the plan text of this viewport, 1.8 or more: room names and labels print at it, room detail lines at 0.7 of it but not under 1.8. Wins over the labelMm of the saved view. Markers and level labels keep their own size. Absent leaves the view’s sizes.
{ weightMm?: number; ink?: string; }
A rectangle on frame: weightMm (more than 0, default 0.35) and ink (#rrggbb, default black). Absent draws none.
{ text?: string; showScale?: boolean; }
Title drawn beneath the viewport. Absent draws nothing.
PaperStyleId
This viewport’s style, outranking the sheet’s and the document’s — how a 1:20 detail hatches differently from the 1:100 plan beside it.
PaperStyle
The narrowest overlay: layered over the document’s and the sheet’s.

ViewSource

What the viewport draws — resolved by the core drawing extractor (§7).

SavedRasterIsometricView

Saved rendering intent, independent of generated pixels and sheet placement.
string
required
string
required
'raster-iso'
required
ProjectionCamera & { projection_mode: 'Orthographic'; }
required
RasterViewFrame
required
number
required
Camera-space clipping distance in metres; must exceed camera.near.
string[] | 'all'
string | null
required
Null means transparent; an opaque background is a #rrggbb colour.

SavedPlanView

A saved plan view: a horizontal cut of one storey, or a site plan when it names no storey. The package does not export this type by name.

SavedRoofPlanView

A saved roof plan of one building: every roof of its storeys, whole, seen from above, with the outer faces of the walls of every storey of the building as one dashed line under them. The package does not export this type by name.
'roof-plan'
required
string[]
The saved ids of what this view alone does not draw: elements, blocks, context buildings or whole buildings. A hidden element hides nothing behind it, and its tags and dimensions are not drawn. A hidden opening keeps its hole; a hidden wall or roof takes its openings, rooflights and dormers with it. An id that names nothing is ignored.
string
required
The building whose roofs it draws.
string[]
The storeys whose roofs it draws, in any order. Absent means every storey with a roof.
'draw' | 'omit'
'omit' leaves out every rooflight and its tag, as a view hides one category: a small-scale site drawing shows plain roofs. Default 'draw'.
number
Height of the pitch text, in paper mm: finite and 1.8 or more.
'existing' | 'proposed' | 'complete'
string[]
Element IDs admitted to the existing or complete state on this view alone. Hidden IDs still win.
boolean
The site boundary and owned land under the roofs. Off when absent.
SiteBoundaryLabel
A text repeated along each edge of the site boundary, outside it, as on a storey plan, laid out at the scale of the first sheet viewport that shows the view (1:100 on no sheet). Drawn only with showSiteBoundary. No text when absent.
'none' | 'auto'
auto tags each rooflight the roof plan draws with the text openingTagText gives it, with no frame, as on a storey plan. Off when absent.
'label' | { propertySet: string; property: string; }
What a rooflight tag shows. Default label.
boolean
Context building outlines under the roofs. Off when absent.
{ draw: 'line' | 'band'; bandMm?: number; }
How ridges, hips and valleys draw: line (the default) one line, band two lines bandMm (default 1) paper mm apart, centred on it, at the scale of the first sheet viewport that shows the view (1:100 on no sheet).
'none' | 'material'
How the roofs fill: material (the default) with the surface pattern of each roof’s material, none with no pattern. The material, its elevations and its sections do not change.
'draw' | 'omit'
The slope arrow and the pitch text of each slope: omit leaves both out of this view. Default draw.
'draw' | 'omit'
The walls under the roofs, dashed: omit leaves them out of this view. They still hide the part of a slab that is inside them. Default draw.
{ lightDeg: number; tones?: string[]; }
Fills each slope of the roofs by the way it falls, as light from one side. lightDeg is where the light comes from, in degrees clockwise from project north (-Z) seen from above: 90 lights the slopes that fall to the east. tones are the fills, #rrggbb, two or more, the first on the slopes towards the light and the last on those away from it (default a light and a dark grey, ['#999999', '#4c4c4c']). A flat roof has no slope and takes none; a dormer and a bay roof take the tone of the slope under them. No fill when absent.
'draw' | 'omit'
The placed blocks of the building: draw draws the plan symbol of each, such as a tree, where it stands clear of the building and no higher roof or slab hides it, with its phase by the phaseFilter. Default omit.
'fixed' | 'fit-text'
How a section head bubble holds its numbers, as on a storey plan: fixed (the default, 10 mm) or fit-text.

SavedBlockPlanView

A saved block plan of one building: its roof plan on its site, with map layers, the distances to the boundary and the context buildings. The package does not export this type by name.
'block-plan'
required
string[]
What this view alone does not draw, as on a roof plan. The boundary distances stay those of the real buildings; with the building of the view hidden there are none.
string
required
The building whose roof plan it draws.
string[]
The storeys whose roofs it draws, in any order. Absent means every storey with a roof.
number
Height of the label text, in paper mm: finite and 1.8 or more.
SavedMapLayer[]
The map layers under the plan, bottom first.
'auto' | 'none'
Dimensions from the building to the nearest boundary edge on each side. Default auto.
boolean
Context building outlines. Default true.
'draw' | 'omit'
'omit' leaves out the site’s context buildings and keeps its roads, as a view hides one category: when a map layer already draws the buildings round the site, a neighbour modelled by hand would draw twice. The boundary distances then measure to the plan’s own buildings only. Default 'draw'.
{ level?: boolean; heightMm?: number; }
The names of the context buildings. level names print level on the sheet however its viewport turns the plan; otherwise a name turns with the plan. heightMm is their height on the paper, 1.8 or more, in place of labelMm.
{ names?: 'draw' | 'omit'; withinM?: number; }
The roads and the waters of the site. names: 'omit' leaves out their names. withinM draws only what is inside the site boundary or no more than that many metres from it, 0 or more; it does nothing on a site with no boundary; it cuts the contours too. Absent: every line and name.
boolean
The roads of the site, with their names. Default true.
boolean
The waters of the site, with their names. Default true.
SavedContours
The contours of the site’s surroundingGround. None when absent.
boolean
Light fills under the linework: the waters, the roads, the context buildings and, in the colour of the paper, the footprints of the model’s buildings, as far as the view draws their lines. Default false. Their colours are the pens WATER_FILL, ROAD_FILL and CONTEXT_FILL.
SavedDetailLine[]
Lines drawn by hand on this view alone, such as the edges of a drive, over everything else. They do not move or resize the plan on its sheet.
'existing' | 'proposed' | 'complete'
string[]
Element IDs admitted to the existing or complete state on this view alone. Hidden IDs still win.
SavedRoofPlanView['ridgeLines']
How ridges, hips and valleys draw, as on a roof plan, but at 1:200 on no sheet.
SavedRoofPlanView['roofPattern']
The surface pattern of the roofs, as on a roof plan. Default material.
SavedRoofPlanView['pitchMarks']
The slope arrows and the pitch, as on a roof plan. Default draw.
SavedRoofPlanView['slopeShading']
A fill on each roof slope by the way it falls, as on a roof plan. No fill when absent.
SavedRoofPlanView['wallsBelow']
The dashed walls under the roofs of every building, as on a roof plan. Default draw. The building outlines that the plan draws at 1:1000 and smaller stay.
SavedRoofPlanView['rooflights']
The rooflights of every building, as on a roof plan. Default draw.
SavedRoofPlanView['blocks']
The placed blocks of every building, as on a roof plan. Default omit.
boolean
At the 1:1000 scale of its sheet viewport and smaller, the plan draws each building as the outline of its walls in a heavy pen, with no roof lines and no texts, as a location plan does; true adds a light hatch inside the outline. Default false. Larger scales draw the roof plan.

SavedViewBase

The package does not export this type by name.

PhysicalDrawingScope

Omitted scope means the entire model; an explicit list never silently drops unsupported IDs.
string
One building: the view draws it and leaves every other building of the model out.
string[]
The buildings the view draws, by id, nonblank, each once and each in the model: every other building is left out, with its elements, level heads and grids. Absent with no buildingId: every building. Not with buildingId; an empty list is refused.
string[] | 'all'
string[]
The saved ids of what this view alone does not draw: elements, notes, grids, blocks, context buildings or whole buildings. A hidden element hides nothing behind it, and its tags and dimensions are not drawn. A hidden opening keeps its hole; a hidden wall or roof takes its openings, rooflights and dormers with it. An id that names nothing is ignored.
PhysicalDrawingSettings
boolean
Show the massing: each part of the mass of every building, cut in a section and seen in an elevation. Off when absent. The ground line of the site draws either way.
'existing' | 'proposed' | 'complete'
existing draws the model before the work, proposed after it with the demolished work, and complete the finished building without the demolished work. Absent: no phase graphics.
string[]
Element IDs admitted to the existing or complete state on this view alone. Hidden IDs still win.
boolean
Draw the site boundary. Off when absent.
boolean
Context buildings of the site. Default true in an elevation or a section; false leaves them out.

WorldXZ

World XZ coordinates in metres, written as [x, z]. The package does not export this type by name.

SavedLevelHead

A level head of a section or elevation; a reference that names nothing draws nothing and warns.

SavedHeightDimension

A vertical dimension between two heights of the model, at at metres across the view frame.

SavedPartialCrop

Draw only inside outline, in the crop frame of the view: metres, x right, y up.
[ number, number ][]
required
number[]
The edges drawn as a break line; edge i runs from outline[i] to the next point.
'zigzag' | 'plain'
How a break edge draws: zigzag (default) puts a zigzag at its middle, plain draws it as one straight line.

ProjectionCamera

Projection camera for the extractor.

ClassStyle

One element class’s treatment.
boolean
false drops the class before projection — it costs nothing downstream.
number
An explicit lineweight in paper mm. Prefer ladderStep, which keeps the weight a rung on PEN_LADDER_MM.
number
Rungs to walk on PEN_LADDER_MM. Steps SUM across the style, the class, its byKind entry and the edge class.
string
Stroke colour, as CSS. On MAP, a map layer’s style ink wins over it.
number[] | 'none'
Dash runs in paper mm; "none" makes the line continuous.
string | 'none'
Poché fill for regions; "none" removes it. "material" gives each cut the poché it has with no statement of the style: the hatch or the solid fill of its material.
string | HatchSpec | 'none'
Poché hatch: a key into HATCH_PATTERNS, a literal spec, or "none". "material" draws the hatch of the cut’s own material, and leaves a cut whose material has none at the stated fill.
'butt' | 'round'
'normal' | 'bold'
The weight of a text primitive: bold sets it in the bold face. Default normal.
Partial<Record<PrimitiveKind, Omit<ClassStyle, 'byKind' | 'parts' | 'edgeClasses'>>>
Per primitive kind, merged over the class entry — how a door’s swing (an arc) is drawn lighter than its leaf (a line) without a second class.
Record<string, Omit<ClassStyle, 'byKind' | 'parts' | 'edgeClasses'>>
Per named part of a symbol, keyed by the primitive’s style.subId and composed after byKind and before the edge class. visible: false drops the part. The outline of the joined walls of a plan is the outline part of WALL, and the lines between wall layers its layer-boundary part, which keeps 0.25 mm unless the part states a weightMm. The plan cut of a curtain wall’s members is the mullion part of WALL, of which only visible is read.
Record<string, Omit<ClassStyle, 'byKind' | 'parts' | 'edgeClasses'>>
Per HLR edge class (VisibleCrease, Hidden, …) on this class only, composed after the style-wide edgeClasses entry. visible: false drops that edge class on this class; visible: true draws it where the style-wide entry drops it.

DepthBand

One band of PaperStyle.depthBands. The package does not export this type by name.

PhaseStyle

One phase’s treatment: a delta on every primitive of that phase, then one per element class.
Record<string, Omit<ClassStyle, 'edgeClasses'>>
Keyed by ElementType, composed after the phase entry on a primitive of that phase and class, with its byKind and parts. visible: false drops the class in that phase.

AnnotationTextStyle

The ground behind a sheet’s text annotations (kind: 'text').
'none' | 'paper'
'paper' blanks the area behind each note; 'none' (the default) does not.
number
The paper round the text that the blank box adds, in mm: finite and 0 or more. Default 0.5.

HandProfile

The character of hand-drawn linework.
number
required
number
required
Peak displacement of the field, in mm. 0 draws ruled lines.
number
required
The weight the amplitude is quoted at; a stroke’s interior samples scale by √(weight / weightRefMm), so heavier nibs wander more.
number
required
Cell size of the field. Two faces of a wall a few mm apart sample nearly the same value, so the wall keeps its thickness; a long stroke crosses several cells and reads as a shallow S.
number
required
Strokes shorter than this are not subdivided (their ends still follow the field, so they stay attached).
number
required
Sample spacing along a stroke, and the cap on samples per stroke.
number
required
{ amplitudeMm: number; latticeMm: number; }
A second, finer octave of the field laid over the bow — the nervous wander of a fineliner on a napkin. Positional like the bow, so shared vertices still agree. Absent means the bow alone; segmentLenMm must be a fraction of latticeMm for the wander to be sampled.
number
required
Axial overrun past a corner: the start is placed, the finish is a lift.
number
required
number
required
A turn sharper than this is a corner (pen lifted); shallower is one stroke.
number
required
Share of corners drawn crossed; the rest stop short by an open gap. One decision per corner, shared by every stroke that meets there.
number
required
number
required
Array<{ atOrAboveMm: number; strikes: number; }>
required
Strikes by weight band, e.g. [&#123; atOrAboveMm: 0.35, strikes: 2 &#125;].
number
required
number
required
number
required
number
required
number
Each re-strike wanders on its own by this much (mm) instead of tracking the first pass exactly — the passes cross and the line goes hairy.
number
required
A short stroke at the start at startBeadWidthFactor × weight (a bead when > 1, a ramp when < 1). 0 draws none. Only on strokes long enough to carry one.
number
required
number
required
A short stroke at the end at endTaperWidthFactor × weight. 0 draws none.
number
required
number
required
± fraction of the nominal weight, one value per emitted stroke.
number
required
number
required
number
required
number
required
number
required
Extra arcs at a radial offset — how a pencil re-strikes a swing.
number
required
Pull the fill in from the outline by this much: the sliver of paper an inked poché leaves against its line. 0 fills to the line.
boolean
Draw the hatch as continuous back-and-forth zigzags across each region — a scribbled poché, ONE stroke per run, laid across the region’s long axis the way a hand scribbles a wall band — instead of separate parallel lines.
number
Per-vertex jitter of a scribble’s pitch and tilt, as a fraction of the spacing — what keeps a scribble from reading as ruled hatching.
number
required
Per-line angle jitter, and one drift per region, both in degrees.
number
required
number
required
± fraction of the spacing, one value per region (so lines stay in register within a region).
number
required
Each hatch line ends between -short and +over of the boundary.
number
required
number
required
number
required
number
required
When the predicted output would exceed this, shedClasses are dropped BEFORE synthesis — a decision about what is on the sheet, never about where a primitive sits in the array.
string[]
required
HandReach
How far the hand reaches beyond the building. By default only viewport geometry is redrawn: dimensions, the frame and the title block stay ruled, because a drawing that wobbles its dimensions is a presentation, not an issue. A napkin sketch is exactly that presentation, and asks for all three.

SheetFrameOptions

What a document may say about its frame.
boolean
Draw the border rectangle. Default true once frame is present at all.
boolean
Zone reference grid. Default: on for A3-equivalent and larger.
boolean
Centring marks at the middle of each edge. Default true.
Partial<SheetMargins>
Override any of the four margins.
"left" | "top"
Which edge gets the wide filing margin. Default “left”.

TextAnnotation

string
required
'text'
required
string
required
Point2
required
number
required
string
string
'left' | 'center' | 'right'
number
Degrees about position, counter-clockwise as the sheet is seen (from paper version 2; clockwise before). Absent is level.

DimensionAnnotation

The package does not export this type by name.
string
required
'dimension'
required
string
Named style in PaperDocument.dimensionStyles. Absent uses the default.
Point2
required
Point2
required
number
required
Perpendicular offset of the dimension line from the start→end segment.
string
number
required

LeaderAnnotation

The package does not export this type by name.
string
required
'leader'
required
string
Named style in PaperDocument.dimensionStyles. Absent uses the default.
Point2
required
Arrow tip — points at the thing being annotated.
Point2[]
required
Knee points from the target to the text anchor (last point).
string
required
number
required
'arrow' | 'dot' | 'none'
The mark at the target: an open arrow, a filled dot, or nothing. Default arrow.
'left' | 'center' | 'right'
How the words stand at the last point: they start just past it (left), end just before it (right), or have it at the middle of their foot (center). Default center.

ImageAnnotation

The package does not export this type by name.
string
required
'image'
required
string
required
Data URL or remote URL; emitters must not require a DOM canvas.
{ x: number; y: number; width: number; height: number; }
required

ShapeAnnotation

The package does not export this type by name.
string
required
'shape'
required
ShapeKind
required
Point2[]
required
line/polyline: vertices. rect: [topLeft, bottomRight]. circle: [center].
number
Required for shape: 'circle'.
string
number
string

NorthArrowAnnotation

A north arrow, tied to a viewport: it points trueNorthDeg of the site (a bearing, clockwise) less the viewport’s rotationDeg (counter-clockwise), clockwise from up the sheet.
string
required
'northArrow'
required
string
required
A viewport on the same sheet.
Point2
required
number
Arrow radius in paper mm, more than 0. Default 8.
'needle' | 'arrow' | 'compass' | 'spire'
The drawn form: needle (the default) an open diamond with an N, arrow a solid arrowhead on a shaft with an N, compass a four-point star with N, E, S and W, spire a tall split point that stands on its N, which a radiusMm of 30 or more suits.

ScaleBarAnnotation

A scale bar, tied to a viewport: its length follows the viewport’s scale, and its labels the document’s unit system.
string
required
'scaleBar'
required
string
required
A viewport on the same sheet.
Point2
required
number
Model metres in one division, more than 0. Default: the smallest 1, 2 or 5 × 10^n m (ft in imperial), 1 unit or more, that is at least 8 mm on paper at the viewport’s scale. 1 m at 1:100, 2 m at 1:200, 5 m at 1:500, 10 m at 1:1250.
number
Number of divisions, a whole number of 1 or more. Default 4.
'alternating' | 'ticked'
The drawn form: alternating (the default) filled and open cells, ticked one line with a tick at each division.
string
A nonblank text printed under the bar, such as Metres. Absent prints none.

TableAnnotation

A table of fixed text: a header row from columns, then rows, each with one cell per column.

ScheduleAnnotation

A schedule: a table of the doors, windows or rooms of one building, or of one storey of it, read from the model at export, so it follows each model change.

SheetScheduleAnnotation

A drawing list: one row per sheet of the document, in sheet order, read from the document at export, so it follows each sheet added, renamed or revised.

RevisionTableAnnotation

The revision table of its sheet: a header row, then one row per Sheet.revisions entry in order, with the code, date and description.

LegendAnnotation

A key of the drawing: one row per entry, a swatch then its label, under an optional title.
string
required
'legend'
required
string
required
A viewport on the same sheet.
Point2
required
number
required
string
A nonblank heading, such as KEY. Absent prints none.
LegendEntry[]
required
One entry or more.

PlanTagPlace

The saved place of one plan tag. The package does not export this type by name.

RoomLabelPlace

The saved place of one room label: at is the point of the label’s name line in plan metres, x along world X and y along world Z, the same at every sheet scale. The package does not export this type by name.
{ x: number; y: number; }
required
number
The label turned about at by this many degrees, counter-clockwise as the plan prints, so 90 reads up the page (clockwise before project version 4). Absent: level. The label fits its room along its turned lines, and a leader leaves from its turned box.

PlanLabelClearance

How the labels of a plan keep clear of its section and elevation marker lines (the cut line, its heads and the elevation arrows). The package does not export this type by name.
boolean
required
true keeps the labels and tags clear of the marker lines; false draws as before.
number
required
The clear paper gap from a marker line, in mm: finite and 0 or more.

PlanCurtainWalls

The view settings of the curtain walls of a plan. The package does not export this type by name.
'draw' | 'omit'
omit draws no cut mullion, and the glass line runs on through the place of each, to the end of the wall and to each door. Default draw.
Record<string, { left?: number; right?: number; }>
The sill boards, keyed by the saved id of the wall: how far, in metres (finite, more than 0), a board stands off the face on the left and on the right of the wall, walking from its first point to its last (the left of a wall drawn along +x is towards -z). Each is an outline over the whole grid. Drawn only: it adds nothing in 3D. An id that names no straight curtain wall the plan draws is ignored.

PlanRoomLabel

The lines of the room labels of a plan. The package does not export this type by name.
{ template?: string; }
template writes the ceiling height line; &#123;mm&#125; is the height in mm. Default CH &#123;mm&#125;.
{ show?: boolean; template?: string; decimals?: number; trimZeros?: boolean; hideForUsages?: string[]; outranksCeilingHeight?: boolean; }
The area line. show: false prints no area. template writes it; &#123;area&#125; is the number. Default &#123;area&#125; m². decimals sets the decimal places of the number. Default
  1. trimZeros: true drops trailing zeros, so 13.0 prints 13. Default false. hideForUsages lists the room usage values that print no area, in any case. outranksCeilingHeight: true, in the plan label pass only (not the sheet re-place pass): a label with no clear place inside with all its lines then tries an inside place without the ceiling height line, keeping the area, before a place outside on a short leader with all its lines. Default false: it tries the outside places next and drops both lines only after them.
boolean
nameBeforeLeader: true, in the plan label pass only (not the sheet re-place pass): a label with no clear place inside with its detail lines prints its name alone inside, at its size and then at the smallest size, before a place outside on a short leader with all its lines. Default false: it tries the short leader first.
number
The smallest height every line of a room label (its name, number and area) prints at, in paper mm: finite and 1.8 or more. In each viewport that prints the plan, a label with a line under it grows as a whole, its lines and the gaps between them, until its smallest line prints at this height, so the area line is as readable at 1:200 as at 1:50. Absent: 1.8 mm, the smallest height of ISO 3098. The fit is unchanged: a label in a narrow or crowded room shrinks to fit, at the scale the plan lays out its room labels at (that of the first sheet viewport that shows the view, else 1:100), but its name not under this; when it does not fit, it overflows its room (or takes a leader, as before). A label sized by labelMm prints at that size, so this has no effect on it.

PlanOpeningSymbols

The view settings of the door and window symbols of a plan. The package does not export this type by name.
'open' | 'closed'
closed draws the panels of a FOLDING door in line across the opening. Default open.
'wall-depth' | 'reveal'
reveal draws the frame and the glass of a window without a bay in a band at the wall face of its sill, and leaves the rest of the reveal open. Default wall-depth.
'rectangle' | 'nosed' | 'none'
nosed draws the sill of a window without a bay with a curved front; none draws no sill. Default rectangle.
'pane' | 'line' | 'none'
line draws a bay’s glass as one line at the middle of its frame band; none draws no glass. Default pane.

PlanTagShape

The frame of a plan tag: a circle, a hexagon, or no frame round the text. The package does not export this type by name.

SavedContours

The contours of a site plan or a block plan: a line of the site’s surroundingGround every interval metres above the sea, under everything else.
number
required
Metres between the lines, above 0.
number
Every how many lines one is a heavier index line, a whole number of 1 or more. Default 5.
boolean
The level of each index line along it; of every line when none is an index line. Default false.
number
Height of the labels on the paper, in mm: finite and 1.8 or more. Default 2.

SavedMapLayer

A map of the project file under a site plan or block plan, placed through the site’s projectedAnchor.
string
required
The id of a mapSources entry of the project file.
number
From 0 to 1. Default 1.
MapLayerStyle
Fill, ink and weight by a property of the features. Absent: every feature as the MAP class.
MapLayerLabels
Names the features by a property, once for each value. Absent: the layer draws no text.

SiteBoundaryLabel

A text repeated along the site boundary: once in the middle of each edge, or one for every spacingM metres of the edge when set. The package does not export this type by name.
string
required
The text, nonblank.
number
Metres of edge for each text, finite and more than 0. Absent: one text per edge.

SavedDetailLine

An open line of one view. The package does not export this type by name.
string
required
[ number, number ][]
required
World XZ points, two or more, no two in a row the same.
number
Pen on the paper, in mm, above 0. Default 0.18.
boolean
Default false: a solid line.

PhysicalDrawingSettings

Shared appearance for technical vectors and raster presentation of one saved view.
'visible' | 'cut-only'
Absent means actual cut plus visible context; cut-only applies to sections.
boolean
Absent means hidden lines are omitted from technical vectors.
string | null
Raster background. Absent means white; null means transparent.
{ datum: number; unit: 'm' | 'ft'; decimals?: number; suffix?: string; }
Authored storey elevations, relative to this world-height datum in metres. decimals (0-3, default 3) rounds the value; suffix is printed after the unit (+5.4 m OD).
'refuse' | 'leave-out'
boolean
Glass hides what is behind it. Default true.
'none' | 'dashed' | 'solid'
Opening marks in elevation. Default none.
'draw' | 'omit'
The colours of the materials on seen faces (surfaceBackground, surfacePatternColor). Default draw; omit leaves them out and keeps the pattern lines in their pen.
'closed' | 'open'
Door leaves in elevation and section. Default closed; open draws the swing pose.
{ extent: 'crop' | 'site-boundary'; stopAt?: 'cut-building' | 'outer-walls'; outsideRunM?: number; fillBelow?: boolean; }
How far the ground line runs. Default crop; site-boundary ends it where the view plane crosses the site boundary, and keeps the crop with a drawing warning where it crosses none. Sections only: stopAt is where the ground stops at the cut building, cut-building (the default) at the outer end of any cut part standing on the ground, outer-walls at the outer faces of the cut walls standing on the ground, running under steps and slabs outside them; outsideRunM limits each run outside the building to that many metres from the stop, and always reaches the outer end of the cut parts standing on the ground. No limit when absent. fillBelow: true (sections only) fills the ground under each run of the ground line down to the bottom of the crop, as a SITE region of role ground with the producer fill earth (a paper style with producerFill: 'ignore' takes it from roles.ground). Off when absent.
boolean
Sections only. true draws each room the section plane crosses as a closed thin line, its outline cut by the plane from its floor to its height. Off when absent.
'draw' | 'omit'
Sections only. omit leaves out the cut and seen material under the ground line of the site; the ground line stays. Default draw.
{ frameLines?: 'both-faces' | 'outer'; sashOutlines?: boolean; sill?: 'box' | 'line' | 'none'; }
How doors and windows draw in elevation and section. frameLines: 'outer' draws the frame, mullions and transoms of a window as one band (default both-faces); sashOutlines: false leaves out the inner outline of each sash (default true); sill draws a sill as its box, its top line only, or not at all (default box).
'draw' | 'omit'
Automatic heads of each storey and saved level. Default draw. Authored levelHeads and grids always draw.
'stack' | 'off'
Level heads, automatic and authored, whose text would meet on the paper. Default stack: on each side the lowest head stays on its level and each head above it moves up, 1 mm clear of the text of the head below, at the scale of the view’s first sheet viewport (1:100 when on no sheet). A moved head keeps its true value and its level line stays on its true level, turning up to the head 2.5 mm off the model. off draws every head on its level, as before.
'draw' | 'omit'
Placed blocks (furniture and fixtures). Default draw; omit leaves every block out.
'draw' | 'omit'
Doors, windows and voids that do not fit their wall: the wall has no hole for them and the build warns opening-does-not-fit. Default draw at their saved place; omit leaves them out.
SiteBoundaryLabel
A text repeated up each site boundary line, outside the site. No text when absent.
{ top?: 'crop' | 'eaves' | { heightM: number; }; behindBuilding?: boolean; }
Where the site boundary line starts. top is the top of the crop (the default), eaves the highest eaves of the building in the view, or a world height in metres. behindBuilding: true hides the line where the building is in front of it. Absent: from the top of the crop, drawn over the building.

SavedHeightRef

A height of the model that a level head or a height dimension follows.

HandReach

The sheet furniture a hand profile may redraw, besides the building.
boolean
Dimension, leader and view-title lines, and un-coloured shape annotations. Labels keep their measured value; authored colours (a redline) stay ruled.
boolean
The drawing frame: border, zone ticks, centring marks.
boolean
The title block’s boxes and rules (a filled box stays ruled).

ShapeKind

The package does not export this type by name.

TableColumn

One column of a table: its header and its width in paper mm.

ScheduleOf

What a schedule lists.

ScheduleColumn

One column of a schedule: the field, and optionally its header and width in paper mm.

LegendEntry

One row of a legend: its swatch and the text beside it.

MapLayerStyle

The look of the features of a map layer by the value of one feature property.
string
required
The feature property whose value picks the entry of values.
Record<string, MapFeatureStyle>
required
The look of the features whose property has that value, as text.
MapFeatureStyle
The look of the features that no entry of values names. Absent: the MAP class.

MapLayerLabels

The texts of a map layer: each value of property among its features, written once — along the middle of the longest line that carries it, turned along that run and readable from the bottom or the right; else at its point; else level at the area centre of its largest polygon.
string
required
The feature property whose text is written. A feature without it is not named.
number
Text height on the paper, in millimetres. Default 2.5.

SavedMeanGroundRef

The mean ground height around a building: along the outer faces of the walls of its lowest storey, on the finished ground (ground: 'finished', the default: the site’s groundPoints, else flat at its elevation) or the existing one.

ScheduleField

A field a schedule column shows.

LegendSwatch

What a legend swatch shows: the paper style of its legend’s viewport resolves it as it resolves the drawing, so the swatch has the fill, hatch, ink and dash of the drawn element.
string
required
The element type, such as WALL.
BmPhase
The phase, as the view stamps it with a phaseFilter. Absent: no phase.
string
The saved material, as the plan cut of a wall stamps it. Absent: no material.
DrawingSurfacePattern
A seen face pattern, drawn at the viewport’s scale. region swatches only.
'region' | 'line'
required
region draws a filled box with its outline, line a short line.

MapFeatureStyle

The look of one class of map features.
string
The fill of a polygon, #rrggbb, under all the lines of the layer.
string
The line colour, #rrggbb. It wins over the paper style.
number
The line weight in paper mm, more than 0.
Last modified on December 1, 2026