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. startWallDrawing(wall)starts the wall tool with the settingswall, and the plan takes the keyboard unless a text field of the page has it. Until the first point, the field by the cursor saysClick or type x Tab y. The user clicks each point, or types the start as x, Tab and y (y is up the plan, toward -Z), then Enter, and each next point as a length in metres, Tab and an angle in degrees (0 is +X and a positive angle turns counter-clockwise, so 90° points up the plan, toward -Z), then Enter. The value being typed is in bold, in a box; the field stands off the draft line. A minus sign or a zero length is ignored; the length is in metres. Enter without a value finishes the wall as onecreate-wall. The first Escape clears a typed value; the next one cancels the draft.const drawing = plan.startOutlineDrawing({ curves: true })starts a free outline with curved sides.plan.setWallDrawingMode('arc')curves the next sides: click a point the side passes through, then its end.plan.setWallDrawingMode('line')goes back.await drawinggives{ points, arcs }, orundefinedwhen the user cancels.arcshas one entry per side,nullfor a straight side; the last entry is the closing side.arcsis absent when every side is straight. If the user closes the outline after a point on the arc, the last side is curved through that point.- 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
Undo and redo through another history, such as a project manager; default is the session.
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.
Whether a saved view names the storey; Delete of a part of a mass keeps such a storey.
Properties
Read-only. The renderer of the plan. Assign
renderer.onDrag for live figures during a grip drag
(the same rules as GUIEditor.onDrag), renderer.onChange for each saved edit, and
renderer.onGestureEnd to draw again from the session at the end of each press of a grip or a
body (a session draw refuses with live-edit-open while the press is open).Methods
selectedPart
mount
startWallDrawing
setWallDrawingMode
curves: true, straight or curved.
startOutlineDrawing
undefined when the user presses Escape or the draft ends otherwise (another gesture, a change of the model, dispose).
startInstancePlanSymbolDrawing
finishInstancePlanSymbolDrawing
cancelInstancePlanSymbolDrawing
resetInstancePlanSymbol
startMassDrawing
add-building from massBuildingCommand; renderer.onChange gets a create) and resolve with the id of the new mass.
startBeamDrawing
startRailingDrawing
add-element in railings; renderer.onChange gets a create), then resolve with its id.
startPlacement
outline (plan XZ metres about the insertion point, unturned) as a ghost that follows the cursor, snapped against this storey’s walls and the plan’s snap points, and call onPlace with where it stood for each click — return true to place another.
placeHostedOpening
opening where a placement started with it showed its ghost (placed.host), as one step (add-hosted-opening at placed.host.station; renderer.onChange gets a create), select it and return its id.
setWorkingGrid
grid when no geometry is in reach (12 px): the cue reads “250 mm grid”.
setPolarIncrements
setLengthFormat
lockDirection
releaseDirection
guides
addGuide
origin along direction (plan XZ metres) and return its id.
addGuideFromEdge
rightAsDrawn metres to its right going from start to end (negative: to its left): a wall of this plan’s storey by id (its first segment’s axis) or a segment.
offsetGuide
rightAsDrawn metres to its right along its direction (negative: to its left) and return the new id; undefined when no guide has id.
moveGuide
deleteGuide
clearGuides
setGuidesVisible
divideSpan
start to end into n equal bays: the n - 1 points between them are marked on the plan and snap until clearGuides or the next division, and are returned.
measureTo
selection
setSelection
ids in the plan, with anchorId the member an alignment keeps fixed (else the first).
onSelectionChange
callback on every change of the selection set; the renderer’s select event still fires for a single selection.
setAnchor
previewArrange
value, the first fixed and the rest stepped by it), or repeat each member count times by step.
commitArrange
cancelArrange
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
resolveHostedPlacement
Resolveopening asked at run station requestedStation on segment segmentIndex of wall against the resolved element of that segment: the station add-hosted-opening saves, nearest to the asked one, where the wall cuts it clear of its openings and of a T seam.
Types
PlanMeasurement
A measured clearance between two drawn elements, asManagedPlanEditor.measureTo returns it.
face between parallel facing faces, closest between the nearest points, or interference.WallDrawingAbandon
Why a wall draft ended without a commit:escape (the user pressed Escape), tool (another draft, placement or gesture started), model (the model changed under it: an edit elsewhere, undo, redo, delete or a redraw), resize (the plan resized or was fitted) or dispose.
PlanSelection
The members of a plan’s selection, in the order they were added, and the fixed anchor.ArrangeOperation
An arrangement of the selection: align to the anchor, distribute, or repeat.ArrangePreview
An arrangement preview, asManagedPlanEditor.previewArrange returns it.
ArrangeMemberStatus
What happens to one member of the selection in an arrangement preview.ConstructionGuide
A view-local construction line of a managed plan: throughorigin along the unit direction, in plan XZ metres.
ManagedPlanEditorOptions
WallDrawingTemplate
The package does not export this type by name.OutlineDrawingOptions
HowManagedPlanEditor.startOutlineDrawing collects the outline.
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.
BeamDrawingTemplate
The beams thatManagedPlanEditor.startBeamDrawing draws: every beam of one chain is alike.
RailingDrawingOptions
The railing thatManagedPlanEditor.startRailingDrawing saves.
PlacementSnap
What a placement settled on for one cursor position.The outline’s turn about
at, radians, counter-clockwise seen from above (+X toward −Z), as an
asset instance’s rotationYDeg turns: a ghost turned by it stands where the instance saved at
that turn stands.What it locked onto; absent when the ghost simply follows the cursor.
Where a placement started with an
opening saves it on that wall; at is its position.WorkingGrid
GuideInput
The package does not export this type by name.ArrangementCommit
ResolvedWallRun
The package does not export this type by name.ResolvedHostPlacement
Where a hosted opening asked at a run station is saved, and whether it moved or is refused.SnapWitness
Footprint
The package does not export this type by name.ManagedEditHistory
The package does not export this type by name.ResolvedStoreyWalls
The package does not export this type by name.FillHostRefusal
The package does not export this type by name.XZ
The package does not export this type by name.OrientedRect
The package does not export this type by name.StoreyWallRun
The package does not export this type by name.Related
BuildingSessionWallWallNetworkArrangementAxisArrangementMoveBmBeamBmDoorBmEditErrorCodeBmOpeningBmRailingBmVoidBmWallBmWallArcBmWindowBodyAlignmentBuildingEditCommandBuildOptionsLengthFormatMassBuildingOptionsPoint2PointXZProjectFileRepeatStepResolveReportSelectedPartWallCreateCommandWallOpeningFitReason