Skip to main content
The drawing is a list of lines, arcs, regions and text in metres.

Import

Example

Notes

  • With { session }, the drawing reads the model and the live build of the session. It does not build the model again, and it does not change the live build. The project gives only the views, the sheets and the markers.
  • With { session }, the building model of the project must have the same id as the model of the session. If not, the draw throws ProjectDrawingError with code inconsistent-build. assetSources and massColors with session also throw inconsistent-build: the session has its own.
  • Without a session, drawProjectView builds a temporary copy of the model of the project, draws it and disposes it. Use this for a project file that has no open session.
  • A roof-plan view ({ kind: 'roof-plan', id, name, buildingId, storeyIds?, labelMm?, phaseFilter?, showSiteBoundary?, showContext? }) draws every roof of the building from above, whole: the eaves, ridges, hips, valleys, slope arrows and pitches, in the below-cut pen. A higher roof hides the part of a lower roof under its eave ring. The outer faces of the walls of every storey of the building show as one dashed line, the building footprint under the roofs, also when storeyIds names fewer storeys. Under the roofs, showSiteBoundary: true draws the site boundary (SITE_BOUNDARY) and the owned land (OWNED_LAND) as a storey plan does, and showContext: true draws the outline of each context building of the site (CONTEXT_BUILDING); both are off when absent. No other element is drawn. Without storeyIds it draws every storey that has a roof. It has no cut height, and the plan editors do not edit it.
  • A plan cuts straight walls at the cut height of the view.
  • In a section or elevation, glass hides what is behind it: settings.glassHides defaults to true. With false the glass is see-through, in the vector drawing and in the raster 3D scene. Glass that the section plane cuts still draws as a cut face.
  • An elevation draws how each door and window opens only when settings.openingMarks asks: none (the default) draws no marks, dashed draws every mark thin and dashed, and solid draws them in full, dashed when the leaf or sash opens away from you. Each mark sits in its own opening, and what stands in front of it hides it, glass too while glassHides is on.
  • A section or an elevation of a project with a site draws the ground: the body below the site elevation, or below the surface through the site’s groundPoints when it has them, cut by the view plane. On top of it is a heavy ground line (style.ogType: 'SITE', role: 'ground'), a polyline where the ground slopes; in an elevation of sloping ground it is the outline of the ground as seen, hidden behind the building. By default (settings.groundLine: { extent: 'crop' }) the line goes across the full crop, past the building on both sides, also past the boundary of the parcel. With settings.groundLine: { extent: 'site-boundary' } it draws only inside the site: from each place where the view plane enters the site boundary to the place where it leaves it, so a concave site gives one run per part of the site that the plane crosses. A view plane that crosses no site boundary keeps the line across the crop and gives a warning. In a section the cut and seen building below grade, such as a basement, still draws. In an elevation the ground hides what is below it, such as foundations and a ground-floor slab below grade; with settings.hiddenLines those edges draw dashed. A view that lists its elements has no ground.
  • A section or an elevation gives one region with style.role: 'surface' for the seen part of each face that looks at you, flat or round: a wall face, a roof slope, a slab edge, the face of a curved wall, a round column or a level round beam seen square on. It names its element (sourceRef or sourceRefs) and carries style.faceNormal (a flat face only), style.ogType and style.material (the wall layer, the glass, or the material of its element) when there is one. The surface regions do not overlap. Furniture (blocks) does not hide them, and a face whose seen part ends on a curve that is not a straight line or a circle in the drawing (a round face in front of a sloping face, or a sloping face in front of a round one; the end of a round beam seen end on; a sloping round beam), or whose cover the kernel refuses, gets no surface region and a warnings entry. A surface region has no ink by default: SVG, PDF and the sheet renderer write nothing for it, and toLines, drawingSnapTargets and chainDimensions skip it. A writer of its own (DXF and others) skips a region where style.role === 'surface' and style.fill is not set.
  • In a plan each wall primitive names its wall. The fill of a wall has the sourceRef of its wall segment. The outline of a group of joined walls (style.subId: 'outline', its poché and its rings) has sourceRefs with every wall of the group, in the order of the storey list; the outline of a wall alone has a list of one. Use them, for example, to put the lines of each wall on its own DXF layer. The outline has no sourceRef, so the plan editor does not pick it. A wall below the cut draws subId: 'beyond' lines with the sourceRef of the wall.
  • If Floorkit cannot draw a view, it throws ProjectDrawingError with a code. It does not draw a footprint in place of a cut.
  • A plan view with openingTags: 'auto' also draws a tag for each door (a circle) and window (a hexagon), outside the swing. The text is the view’s labelMm paper mm high, or 2.5 mm. Off when absent.
  • The managed plan editor does not draw the tags. They are on drawProjectView and on the sheets.
  • Tags keep clear of room labels and of each other at 1:100. A tag with no clear place stays at its default place, and the drawing’s warnings name it.
  • A plan view with labelMm prints its text that many paper millimetres high at every scale. Room detail lines print at 0.7 of it, but never under 1.8 mm. A viewport labelMm wins on a sheet.
  • A plan view with labelClearance: { markerLines: true, gapMm } keeps its room labels and its door, window, wall and column tags at least gapMm paper millimetres from its section and elevation marker lines (the cut line, its heads and the elevation arrows), at the scale the plan prints at: 1:100 alone, the viewport’s scale on a sheet. A room label a marker line crosses moves to a clear place inside its room. A tag takes the next clear place along its wall. A room label with no clear place stays where it was, and the drawing’s warnings name it; a tag with no clear place falls back as the other tags do, with its warning. Off when absent: the drawing is the same as before.
  • A plan view with roomLabel: { minTextMm } (paper mm, 1.8 or more) stops a room label from shrinking under that size in a narrow or crowded room, measured at the scale the plan lays out its room labels at: that of the first sheet viewport that shows the view, else 1:100. A sheet at another scale prints the label in proportion. A label that does not fit at it overflows its room or takes a leader, as before. A label whose own size is smaller prints at the minimum. A label sized by labelMm prints at that size, so the minimum does not change it. Off when absent: the label fits as before.
  • A room label placed by hand (roomLabelPlaces) prints exactly at its place, with no clear check: it does not move off the plan lines, the marker lines or other texts.
  • A plan view draws the dimensions, text notes and leaders saved on its storey. See Dimensions on a storey.
  • With sheetAnnotations: { sheetId }, the drawing also has the annotations of that sheet that belong to the view, in model metres, for a DXF file: each measure, angular and radial of a viewport that shows the view, and each paper text (by its position) and leader (by its target) inside the frame of such a viewport. When frames of the view overlap, the first viewport in sheet order takes the note. Paper points map back through that viewport’s scale, centre and rotation. Text keeps its paper size (paperHeightMm). Annotations outside every viewport of the view are not in it. An unknown sheet throws ProjectDrawingError with code unknown-sheet. Off when absent: the drawing is the same as before.
  • Each annotation and marker primitive has a style.ogType, so a DXF writer can put each class on its own layer: 'DIMENSION' (the lines, ticks and value of a sheet measure, angular or radial), 'TEXT' (a sheet text note and the text of a leader), 'LEADER' (the lines and arrow of a leader) and 'MARKER' (every primitive of a section, elevation or reference marker). A sheet annotation also has style.ogid, its id. The dimensions, notes and leaders saved on a storey keep 'ANNOTATION': the plan editor selects them by it.

Signature

Parameters

ProjectFile
required
string
required
DrawProjectViewOptions
Default: {}.

Returns

ProjectDrawingError

Types

VectorDrawing

Plain-data vector drawing returned by a DrawingExtractor.
'meters'
required
PlanVectorBounds
required
DrawingPrimitive[]
required
The standardized drawing geometry.
VectorText[]
Optional model-anchored labels (e.g. from the kernel projection path).
string[]
What the drawing could not do as asked, such as a plan tag with no clear place.
JunctionDiagnostic[]
The walls whose layers the plan could not draw, each drawn as one band: a layer-join-rejected diagnostic that names the wall.
DrawingPrimitive[]
When set, what a sheet centres and fits the drawing on, in place of primitives: a plan with moved or hidden tags gives its tags at their automatic places here, so a tag edit never moves the plan in its viewport. bounds holds them too. Renderers draw primitives only.

DrawProjectViewOptions

The options of drawProjectView: the output options, and what the draw reads.

ProjectDrawingErrorCode

PlanVectorBounds

DrawProjectViewOutput

The options of drawProjectView besides what it reads; see DrawProjectViewOptions. The package does not export this type by name.
{ sheetId: string; }
Also return the annotations of this sheet that belong to the view, in model metres: each measure, angular and radial of a viewport that shows the view, and each paper text (by its position) and leader (by its target) inside the frame of such a viewport (the first in sheet order when frames overlap). Paper points map back by the inverse of that viewport’s model-to-paper transform. Annotations outside every viewport of the view are skipped. Absent adds nothing; an unknown sheet throws unknown-sheet. Sheet exports ignore it: a sheet draws its own annotations.
Viewport
The sheet viewport that shows the view.

DrawSourceOptions

What a draw or an export reads: a session’s live build, or a temporary build. The package does not export this type by name.

TemporaryBuildInputs

A draw or an export with no session: it builds the project’s model, draws, and disposes. The package does not export this type by name.
BuildOptions['assetSources']
The .op text of external assets, keyed by uri. Absent uses the sources saved in the project file; given, it replaces them. Not with session.
BuildOptions['massColors']
The colours of mass parts by use; see BuildOptions.massColors. Not with session.
undefined
No session: the call builds the project’s model, draws, and disposes the build.

SessionBuildInputs

A draw or an export from the live build of a session. The package does not export this type by name.
BuildingSession
Draw from this session: its saved model and its live build, with no rebuild. The project gives only the views, the sheets, the paper and the markers; its buildingModel must have the id of the session’s model, else inconsistent-build. The draw does not change or dispose a live body. With a session, assetSources and massColors are refused with inconsistent-build: the session’s own build options are the inputs. An export draws every view at the call; a later step of the session does not change it. Absent builds the project’s model for this call only.
never
Refused with a session (inconsistent-build): the session has its own asset sources.
never
Refused with a session (inconsistent-build): the session has its own mass colours.

DrawingFont

A TrueType font for drawing text; each face is a whole .ttf file in base64.
string
required
The name a font stack gives it first.
string
required
string
Absent sets bold text in the regular face.

VectorExtractable

Implemented by model elements that can be drawn into a paper viewport — the three-free successor to PlanVectorExportable.getExportRoots().

DrawingSourceRef

A drawing hit may identify a saved feature without granting an edit gesture.

VectorLine

A projected line segment.

DrawingView

Views the extractor can project.

VectorText

A model label/tag projected as vector text (paper renders it natively).
Point2
required
string
required
number
required
Text height in model units (meters).
number
Paper millimetres, overriding height at placement — see DrawingText.paperHeightMm.
number

VectorArc

An optional projected arc segment.

DrawingRequest

Describes what a single viewport draws from model space.
DrawingView
required
{ elevation?: number; sectionId?: string; }
Plan cut-plane elevation, or the section/elevation line id.
ProjectionCamera
Required for view: 'iso'.
PlanProjectionHlr
string[] | 'all'
Which model entities to include, or 'all'.
number
Print every text primitive at this height in paper millimetres, regardless of the sheet scale — stamped onto each as DrawingText.paperHeightMm. Without it a consumer has to rewrite each element’s fontSize before extracting, which mutates the model to change a drawing and reaches only the element types it knows about.

DrawingExtractor

Headless, three-free extraction API.

DrawingLoop

An ordered, implicitly-closed ring of points.

DrawingHatchName

The name of a material hatch, a key of the paper’s HATCH_PATTERNS.

DrawingSurfacePattern

A pattern drawn on the seen faces of a material: BmMaterial.surfacePattern other than none.

DrawingSurfaceLook

Print appearance measured in the drawing’s coordinates.

DrawingFill

Region fill (poché) descriptor.
PlanVectorColor
'solid' | 'hatch'
DrawingSurfaceLook
Optional vector surface fill, clipped by the region including its holes.
DrawingHatchName
The material hatch of the region, drawn in place of a solid fill. It wins over the hatch of the pen; a fill with no hatch keeps today’s solid poché.
true
Fills the region with the paper colour, so it masks the ink drawn before it.

DrawingStyle

'cut' | 'silhouette' | 'projected' | 'hidden' | 'datum' | 'marker' | 'surface' | 'ground' | 'existing-ground'
Physical drawing meaning; paper/renderers resolve its print appearance. ground is the finished ground of the site, existing-ground the ground before the works.
BmPhase
The phase of the source element, stamped when the view has a phaseFilter.
BmPhase
Applies an explicit phase dash to a derived outline while keeping its normal pen by default.
number
Metres from the view plane to the nearest point of the source face of a silhouette or projected line of a section or elevation, stamped by the physical composer. A paper style’s depthBands read it.
[ number, number, number ]
World unit normal of the seen face that a surface region or a pattern line draws.
string
Source element type (“WALL”|“DOOR”|…) → app-side lineweight + fill policy.
string
Saved wall type id on a plan cut outline.
string
Source element instance id. Stamped by the extractor so an interactive 2D renderer can map a picked primitive back to its element (getElementById(ogid) → getEditAnchors()). Unset on the export-only path.
string
Optional sub-feature id within the source element (e.g. “edge:2”, “v:outer:3”) for finer-grained editing/hit-testing. Producers set this when they emit per-feature primitives; element-level picking only needs ogid.
'mullion'
Set on the plan cut of a curtain wall’s members (WALL): their fills and their outline. A paper style hides them with classes.WALL.parts.mullion.visible: false; the pen stays that of the fill or of the outline part.
string
The joined wall group that an outline line bounds: the id of its first wall and the index of that wall’s cut region.
string
The saved material of the cut that a region fills, such as BRICK, for a writer that picks its own pattern by material. Set on the plan or section cut of a saved wall that names a material.
DrawingSurfacePattern
The pattern a line belongs to: a course, joint or bar of the material pattern drawn on a seen face, inked with the surface pattern pen and never by its element’s class.
number
The index in its wall’s build-up of the layer that a region draws.
true
A line where two wall layers of different materials meet, drawn with the material pen; with material: 'MEMBRANE', the line of a membrane between two layers, drawn with its pen.
{ color?: PlanVectorColor; width?: number; }
DrawingFill
Region fill (poché). Unset unless a producer or fill policy assigns it.
number
Opacity of the strokes and fills, from 0 to 1. Unset draws them opaque.
boolean
false draws a region’s fill WITHOUT its own outline. Set when the outline is drawn separately: merged wall poché emits the boundary of the joined mass as line primitives, so each wall’s own ring must not be stroked or every junction seam comes back. Ignored by the other primitive kinds, which are outlines already.
string
Kernel HLR edge class, carried verbatim from projection (e.g. “VisibleOutline” | “Hidden” | “VisibleCrease”), or “SectionCut” for cut outlines in sections and elevations. Unset for authored 2D (plan) primitives. Lets the renderer dash hidden edges, etc.

DrawingPrimitiveSource

DrawingSourceRef
Authored identity for selection; absent when the drawing cannot attribute a source.
readonly DrawingSourceRef[]
Multiple authored owners of merged material. No arbitrary single editable owner.
{ anchor: Point2; scale: number; labelMm?: number; auto?: { anchor: Point2; at: Point2; }; } & ({ resizes?: 'start'; } | { resizes: 'ends' | 'clamped'; endAnchor: Point2; })
A symbol sized on the paper, such as a tag frame: its geometry is drawn for the sheet scale scale (paper ÷ real). A sheet at another scale resizes it about the model point anchor, so it keeps its paper size and its anchor stays put. Absent: the primitive scales with the model. labelMm is the text height it was sized for: a viewport labelMm resizes it by the ratio. resizes: 'start' on a line resizes only its start point; its end keeps its model position, so the line joins a paper-sized symbol at one end and a model point at the other. resizes: 'ends' on a line resizes its start about anchor and its end about endAnchor, so the line runs between two paper-sized symbols and keeps no part of their paper size; resizes: 'clamped' resizes the whole line about anchor. Either keeps each point on its anchor’s side of the middle of anchor and endAnchor; an ends line that shrinks to that middle is not drawn. auto, on a plan tag that the declutter or a saved offset put away from its automatic place only: the anchor and the text point (at) it has there, in model metres. Drawing ignores it; a sheet editor reads it to keep a dragged tag where it is dropped.

DrawingLine

DrawingArc

DrawingEllipseArc

A part of an ellipse: the projection of a circle seen at a slant (the end of a round beam, say).
'ellipseArc'
required
Point2
required
number
required
Half the first axis, in drawing units.
number
required
Half the second axis, in drawing units.
number
required
number
required
number
required
DrawingStyle

DrawingBoundary

DrawingCurvedRegion

DrawingRegion

'region'
required
DrawingLoop
required
Outer boundary ring.
DrawingLoop[]
required
Inner rings (holes) — even-odd voids, e.g. door/window openings in a wall.
DrawingStyle

DrawingText

'text'
required
Point2
required
string
required
'left' | 'center' | 'right'
Horizontal alignment at position; omitted preserves centered text.
'alphabetic' | 'middle'
Vertical anchor at position: middle centres the text on it. Omitted is the alphabetic baseline.
number
required
Text height in model units (meters).
number
Text height in PAPER millimetres, overriding height at placement.
number
boolean
On a sheet the text reads level, however the viewport turns the drawing.
Point2[]
The run the text names, as a road’s name names its road. A sheet whose viewport frame cuts off position sets the text, turned along it, at the middle of the longest part of the run inside the frame instead of leaving it out.
DrawingStyle

DrawingPolyline

An open or closed run of straight segments through points (back to the first when closed).
'polyline'
required
Point2[]
required
boolean
{ points: Point2[]; wallType?: string; }[]
Ordered perimeter runs of a joined wall cut outline, used to apply wall type pens.
DrawingStyle

DrawingImage

A PNG or JPEG picture placed in the drawing, such as a raster map under a site plan.
'image'
required
[ Point2, Point2, Point2 ]
required
The drawing points of the outer corners of the top-left, top-right and bottom-left pixels; the fourth corner completes the parallelogram.
string
required
A data:image/png;base64, or data:image/jpeg;base64, URL of the picture.
Point2[][]
Closed outlines in drawing units; the picture shows only inside all of them.
DrawingStyle

DrawingPrimitive

PlanVectorLine

PlanVectorPoint
required
PlanVectorPoint
required
number
PlanVectorColor
string
Source element type (e.g. “WALL”), for app-side lineweight policy.
Last modified on November 30, 2026