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
onErrorto 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
startWallDrawing
startOutlineDrawing
undefined when the user presses Escape or the draft ends otherwise (another gesture, a change of the model, dispose).
startMassDrawing
add-building from massBuildingCommand; renderer.onChange gets a create) and resolve with the id of the new mass.
projectSnapshot
save
setProject
undo
history, or of the session; renderer.onChange gets a changed building.
redo
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
HowManagedPlanEditor.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 ofManagedPlanEditor.startMassDrawing, and how its outline is drawn.