Skip to main content
It shows one saved plan view and lets the user edit walls and openings. Each edit goes through a BuildingSession, so undo and redo work.

Import

Example

Notes

  • The view must be a saved plan in the project.
  • Give the same session to each plan editor and to the 3D editor. Then all of them show the same building.
  • save() returns the project text with the current building.
  • Set onError to show an edit that Floorkit rejected.
  • If you give a session, you own it. Dispose the editors first, then the session. If you give none, the editor makes one and disposes it.

Constructor

BuildingSession
Share one saved building session across several plans and a 3D view.
Pick<BuildOptions, "assetSources" | "massColors" | "stampMembership">
number
Metres from every wall beyond which a dragged door or window leaves its wall; default 0.35.
ManagedEditHistory
Undo and redo through another history, such as a project manager; default is the session.
((command: BuildingEditCommand) => void)
Refuse a command before a gesture of this plan saves it; throw to refuse. A project manager passes its storey-in-use rule, as it does to a bound 3D editor.
((storeyId: string) => boolean)
Whether a saved view names the storey; Delete of a part of a mass keeps such a storey.

Properties

BuildingSession
Read-only.
string
Read-only.
(error: unknown) => void
unknown
ModelScreenRenderer | undefined
Read-only. The renderer of the plan. Assign renderer.onDrag for live figures during a grip drag (the same rules as GUIEditor.onDrag), and renderer.onChange for each saved edit.

Methods

mount

Mount the editable plan once; callers may mount session.root in their 3D scene.

startWallDrawing

Collect a saved wall axis on this plan.

startOutlineDrawing

Let the user draw a closed outline on this plan and resolve with it, in site XZ metres (the plan’s model coordinates), without saving anything; undefined when the user presses Escape or the draft ends otherwise (another gesture, a change of the model, dispose).

startMassDrawing

Let the user draw the outline of a new building with one mass, then save it as one step (add-building from massBuildingCommand; renderer.onChange gets a create) and resolve with the id of the new mass.

projectSnapshot

save

setProject

Replace the saved views, sheets and markers of this plan; a mounted plan draws again.

undo

Undo one step of history, or of the session; renderer.onChange gets a changed building.

redo

Redo one step of history, or of the session; renderer.onChange gets a changed building.

dispose

Types

ManagedPlanEditorOptions

WallDrawingTemplate

The package does not export this type by name.

OutlineDrawingOptions

How ManagedPlanEditor.startOutlineDrawing collects the outline.
'free' | 'rectangle'
free (the default): each click adds a corner; a click on the first corner, Enter or a double click closes the outline once it has three corners. rectangle: two clicks at opposite corners.

MassDrawingOptions

The new building of ManagedPlanEditor.startMassDrawing, and how its outline is drawn.

ManagedEditHistory

The package does not export this type by name.
Last modified on October 13, 2026