Before you start
Your project has a plan view with the idground-plan. See Create a plan view.
Mount the editor
Open the project in aProjectManager. The manager builds the building and gives each editor the same session. onError gets each edit that Floorkit refuses, for example a drag past a limit. Show its message to the user.
Edit a wall
When the pointer is on an element, the editor shows it in light blue. When the user selects a wall, the editor shows a blue outline around the wall, a line along the wall and these handles:
An end that leaves a corner is free. An end released near the end of another wall joins that end, and the two walls make a corner. An end released near the body of another wall joins that wall. The green square shows that the end will join. When an end leaves a corner inside one saved wall, Floorkit cuts the saved wall there and gives the new part its own id.
The walls, their doors and their windows move while the user drags. When the user releases the pointer, Floorkit saves one edit command. Thus one drag is one step for undo.
Edit a door or a window
When the user selects a door or a window, the editor shows one dot on it.
The door moves while the user drags, and the cut in the wall moves when the user releases the pointer. One drag is one edit command.
Edit a slab, a roof, a room or a stair
When the user selects one of these, the editor shows its handles.
The 3D editor also has a handle for the height: the thickness of a slab, the eave of a roof, the height of a room and the base of a stair.
The element changes while the user drags. One drag is one
reshape command.
Edit a block
When the user selects a block, the editor shows a box around it and a round grip that turns it. A block that names the sizes it offers also has a dot on each side that it can change.- A width or a depth has dots when the block’s definition has a rule for it in
sizing. See Give a block a size. The model must hold the definition, as anembedded-opasset, and thescaleof the block must have magnitude 1. - The box shows the new size while the user drags. The block itself changes when the user releases the pointer.
- One drag is one
replace-elementcommand with the size and the position. The Escape key drops the drag, and a drag that ends within 3 pixels of where it began changes nothing. - A dot is always at least 24 pixels from the middle of the block. Where the block is smaller than that on the screen, the dot stands beside it, on a thin line from its own side. A dot that would be under the round grip moves along its side.
Edit a mass
A plan shows the masses of the site, the parcel and the dashed setback line of its zoning rules when its view hasshowMassing: true. The parcel and the setbacks are drawn only: a click passes through them, and a replace-site command draws them again. The switch is off by default. Turn it on in the saved view, or with a command, which is one undo step:
Each drag and each Delete is one
replace-mass command, as in the 3D editor. To show live numbers, such as the floor area, while the user drags, set editor.renderer.onDrag; it is called on each frame of a drag, before anything is saved. The plan has no handle for the height: change it in the 3D editor or with a command. The manager refuses a gesture that would remove a storey that a plan view shows, and Delete keeps such a storey as a plain storey.
Let the user draw a wall
startWallDrawing starts the wall tool. The user clicks each point. The Enter key finishes the wall and the Escape key cancels it.
To place the next point exactly, the user types its length in metres: a field next to the cursor shows it. The Tab key moves to the angle in degrees, as in CAD: 0 is +X (east), and a positive angle turns counter-clockwise, so 90° points up the plan, toward -Z. Before the first point, the user can type the start instead of clicking it: x, Tab, y (y is up the plan, toward -Z), Enter. The wall tool takes the keyboard as it starts, unless a text field of the page has it, and until the first point the field says Click or type x Tab y. The value being typed is in bold, in a box. The field stands beside the cursor on the side away from the draft line, and turns to stay inside the view at its edges. A minus sign or a zero length is ignored; the length is in metres. The Enter key places the point. Without an angle, the point goes toward the cursor. Backspace edits the value. The first Escape clears the value, and the draft keeps its points. Shift and snapping work as for a click.
Set how the user pans and zooms
A two-finger scroll pans the plan and a pinch zooms it. Ctrl or Cmd with the wheel also zooms. For a user with a mouse, make the wheel zoom.setNavigation also takes your own settings. See createModelRenderer.
Add undo, redo and save
The manager has one history for the building, the views and the sheets. The undo key in the editor uses the same history.undo() and redo() return null when there is no step. save() returns the project text with the current building. Store this text. See Save and reopen.
Remove the editor
dispose() of the manager removes each plan editor and then the session.
dispose() of that editor.
Rules
- You can mount more than one plan editor on one manager, for example one for each storey.
- A door or a window leaves its wall when the user drags it more than 0.35 m from every wall. The option
hostedOpeningDetachToleranceof the manager sets that distance in metres. A door or a window does not leave its wall at a place where the loose door or window would stand in a wall: there it stays in its wall. - While a plan editor shows a view, you cannot remove that view or make it a view that is not a plan. The manager throws
ProjectFileErrorwith the codeview-in-use. - If the editor shows a view that you added in this session, an undo that reaches the “add view” step fails with the same code. Dispose that editor first.
- After a change of the views, the sheets or the markers, the manager draws each mounted plan again.
- A mass is drawn under the elements of the storey. Where a slab or a room covers it, a click selects the slab or the room.
Without the manager
If your app makes theBuildingSession itself, make the editor with ManagedPlanEditor. See the ManagedPlanEditor API.
Next
Add a 3D editor
Edit the same building in 3D.
ProjectManager API
See each member of the manager and the project commands.
Selection controls
Catalog elements have an oriented selection box whose outline uses the existing move operation; rotation follows its local bottom edge. Drag an element body to move it; there is no visible move icon. BIM elements have geometric grips and outside dimensions, with no bounding box. Hosted openings keep their existing movement and hosting constraints. White circular grips have blue outlines and fill blue while active; height controls use the same circular style. Dimension lines and end ticks stay blue in both themes. Opening width and height include the outer frame; sill is measured to the frame bottom. The opening width line and editable chip sit on the wall centerline between the jamb grips for every hosted and free door/window style. They follow live movement and rotation, then retain their attachment after release, cancel and undo. Text stays upright through rotation, pan and zoom. Hosted openings follow their wall’s angle. Drag the line beside the chip to move the opening through its existing movement constraints; click the number to edit width. The visible line stays thin over a wider invisible pointer target. Saved clear sizes keep their existing meaning. Opening height and sill remain editable asH and Sill chips outside the symbol, separate from its measured width. Dimension chips accept exact values through the existing edit commands. Enter or valid blur
saves once, Escape cancels, and invalid drafts leave the saved geometry intact. Complex profiles
show measurements for the hovered or selected edge. Curved-edge radius and angle callouts stay
near that edge; labels avoid overlapping one another. A standalone createModelRenderer host can
supply ModelEditDeps.dimensionFormat() for display units and precision; a project-bound plan
uses the project’s unit system. Units do not change saved model coordinates.
The rotation stem follows a fixed axis in the element’s local frame and its symbol stays upright.
The same authored edge remains attached through quarter turns. Measurements for authored primitives
use their existing edit drafts. Unsupported size operations show read-only physical spans rather
than adding scaling; holes in walls expose width and height measurements.
Fit view reserves model-space room for editing rails and rotation controls around the drawing.
This framing does not move any dimension attachment or change manual pan and zoom.