Before you start
- You have a project. See Create a plan view.
- You have a scene, a camera and camera controls, such as
OrbitControls.
Open the project
Open the project in aProjectManager and add manager.root to your scene one time. onError gets each edit that Floorkit refuses, for example a drag past a limit. Show its message to the user.
Mount the editor
GUIEditor needs the element that holds your canvas, your camera and your controls. It stops the controls while the user drags a handle. bindSceneEditor connects it to the project.
Update it in each frame
Callupdate() before you render. The handles then follow the camera.
Edit a wall
When the user selects a wall, the editor shows 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. 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
Select a door or window to see its circular resize grips and frame-inclusive measurements. Drag its body to move 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.
A slab with a hole also has a dot at each corner of the hole. This slab is next to the room of Draw a wall, and its hole is near one end. When the user drags a corner of the hole out of the slab, the manager refuses the edit and sends the error to onError. The hole stays.
replace-element is one step for undo.
Let the user draw a wall
startWallDrawing starts the wall tool on the floor of a storey. It works as the wall tool of the plan editor: the user clicks each point, can type a length and an angle, and pushes Enter to finish. The editor saves one create-wall, the same command as the plan editor.
bindSceneEditor or bindManagedSceneEditor. A live scene without a building model uses setTool with a WallTool.
Add undo and redo
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 the new revision, or null when there is no step.
Change a field
An inspector changes a field of the selected element withreplaceFields. The keys are the paths of the element’s editable schema, such as height of a wall. Each call is one step that undo reverts. A value that cannot be saved throws, and the element stays as it was.
onChange. Listen with manager.subscribe, or use the change that replaceFields returns.
Remove the editor
You made the editor, so you dispose it. Then remove the project.Rules
- The container must be the element that the canvas fills. The editor uses its size to place the handles.
- An object with an
enabledproperty is sufficient forcontrols.OrbitControlshas one. - The plan editors and the 3D editor of one manager use the same
hostedOpeningDetachTolerance. Set it in the options of the manager. - The manager does not dispose the
GUIEditor. Dispose the editor before you dispose the manager.
Without the manager
If your app makes theBuildingSession itself, connect the editor with bindManagedSceneEditor. See the bindManagedSceneEditor API.
Next
GUIEditor API
See each member of the 3D editor.
ProjectManager API
See each member of the manager and the project commands.
Resize a block
Select a placed catalog block with a width or depth size rule. Drag a grip along that axis to preview the nearest offered size. The opposite side stays fixed. Hold Alt to keep the center fixed. If you are looking straight down the resize axis, orbit to bring the grip into view. The box and dimension label update as you drag. Release to rebuild the block and save one undo step, or press Escape to cancel.Selection boxes and exact dimensions
Catalog elements use an oriented wireframe box with rotation attached below its local bottom edge. The stem follows a fixed model-space local axis through camera changes and quarter turns; the rotation symbol remains upright. An edge-on or clipped attachment is hidden. Drag the element body or box outline to move it. There is no visible move icon. BIM elements—walls, slabs, roofs, rooms, stairs, doors, and windows—use their own geometric grips and dimensions without a selection box. Existing movement, hosting, detach, and rehost behavior is preserved. Dimension lines and end ticks use the blue editor accent in both themes. Rails, ticks, and label attachments use fixed model coordinates for walls, profiles, holes, circles, stairs, height, and elevation. They project with the element through camera orbit, pan, and zoom; only the text stays upright. Wall length and height are measured on the visible vertical wall face. Opening measurements and resize grips follow the outer frame on the visible physical face, including its actual wall depth. Overall width and height include the frame; the sill measurement is to the frame bottom. Saved glass/panel dimensions keep their existing meanings. An overall size edit changes the corresponding clear size by the same amount through the existing writer. Jamb grips sit at side midpoints and head/sill grips at the top/bottom. Native resize cursors follow the projected edit axis. Drag the opening body to move it, with its existing host, detach and rehost behavior. These display positions preserve the authored anchors and drag constraints. Measurements sit outside the element and avoid one another. Opposing equal spans are shown once. Inspect a curved edge to see its radius and angle next to that edge; these use short callouts, not lines to a distant mathematical center. Slab thickness is measured at a fixed authored perimeter point. Simple profiles keep both independent spans visible while an edge is edited. Inner rings expose editable hole edge lengths through the same validation and history as corner dragging. Selecting a segment of a multi-segment wall run exposes that segment’s native endpoint, connected-wall, and bend controls. It does not show whole-run movement or rotation controls around the rest of the building. Whole-run transform commands remain available through the API. Circular grips replace the height triangles. Radius, arc, and rounded-corner controls carry small symbols for their editing operation. Movable elements use body dragging in the default edit mode. Click a measurement chip to type an exact value. Enter or a valid blur saves one edit; Escape restores the value. Empty and invalid drafts do not change geometry. A refused size keeps the existing element and reports the refusal.getEditDimensions() returning EditDimensionDescriptor[] for
additional domain measurements; its edit callback must use the target’s validated transaction
and undo history. Endpoint coordinates use the target’s anchor frame. For profile targets they
use profile X/Z coordinates and height above the profile plane.
Targets can optionally implement getEditFaces() with EditFace records. Face normals and
anchor positions use the same coordinate space as getEditAnchors(). The editor chooses the
visible physical face without changing authored anchor identities. Without this optional
contract, existing target presentation continues working. A wall height span is a read-only
measurement; it does not add an unsupported segment-height operation.
RectanglePrimitive derives its editable profile from its parametric configuration.
Reading that profile does not change the rectangle. Assigning a profile switches it to profile
mode; its edit lifecycle preserves the original mode for undo:
ModelObjectPresentation handles may provide a glyph (radius, arc, or corner)
and a plane-local axis direction for the resize cursor. These fields affect presentation only;
handle IDs and edit drafts retain ownership of validation and history. A ModelObjectPreviewOptions
projection can return visible: false for clipped or behind-camera points.