Skip to main content

SheetBoard

An infinite pannable/zoomable canvas for arranging technical drawing sheets.

Fires

viewportselect - { paper, drawingId, viewportId } on single-click selection

Fires

viewportdeselect - { paper, drawingId, viewportId } on deselection

Fires

viewportactivate - { paper, drawingId, viewportId } on double-click

Fires

viewportdxfexport - { drawingId, viewportId, dxf } when the viewport Export DXF button is clicked

Fires

paperdxfexport - { paper, dxf } when the paper Export DXF button is clicked

Element

bim-sheet-board

Extends

  • LitElement

Properties

components

components: null | Components = null

Optional Components instance. When set, the "Export DXF" button in the paper toolbar computes the DXF file internally and fires a paperdxfexport event with the resulting string.

Methods

addViewport()

addViewport(paper, drawingId, viewportId, pos): void

Registers a DrawingViewport to be rendered inside a bim-paper-space element at the given position.

Parameters

ParameterTypeDescription
paperPaperSpaceThe paper sheet that will display this viewport.
drawingIdstringUUID of the TechnicalDrawing that owns the viewport.
viewportIdstringUUID of the DrawingViewport to render.
posobject

Top-left position of the viewport in mm, measured from the

drawing area origin (inside the paper margin).

pos.xnumber-
pos.ynumber-

Returns

void


enterEditMode()

enterEditMode(drawingId, viewportId): void

Enters edit mode for the given viewport: the board stops intercepting pointer events on that slot so an external editor can take over. The slot stays visually selected but drag/resize/click are suspended.

Parameters

ParameterType
drawingIdstring
viewportIdstring

Returns

void


exitEditMode()

exitEditMode(): void

Exits edit mode, returning pointer control to the board.

Returns

void


getSlotsForPaper()

getSlotsForPaper(paper): object[]

Returns the viewport placements registered on the given paper sheet as plain data objects, suitable for passing directly to a DXF exporter.

Parameters

ParameterTypeDescription
paperPaperSpaceThe paper sheet to query.

Returns

object[]

Array of { vp, x, y } where x and y are mm from the top-left of the drawing area.


getViewportElement()

getViewportElement(drawingId, viewportId): null | HTMLElement

Returns the HTML element that covers the screen area of the given viewport. Useful for registering the viewport as a pointer-event source with an external editor (e.g. DrawingEditor.registerSource).

Parameters

ParameterType
drawingIdstring
viewportIdstring

Returns

null | HTMLElement


removeViewport()

removeViewport(paper, drawingId, viewportId): void

Removes a previously registered viewport from a paper sheet.

Parameters

ParameterType
paperPaperSpace
drawingIdstring
viewportIdstring

Returns

void


requestRender()

requestRender(): void

Schedules a WebGL render pass on the next animation frame. Call this whenever drawing content changes (new annotation, projection update, etc.). Multiple calls within the same frame collapse into one.

Returns

void