Import
Example
Notes
- All dimensions are in metres. The rail height is measured above the path.
Stair.attachRailingmakes this live railing follow a live stair. Detach the railing before you dispose it. A saved railing follows its stair only throughhost(see below).balusterSpacingsets the distance between balusters. The clear gap also depends on the baluster size.- The default sizes are not a safety-code check.
- When you replace
topRail, give its width and its height. - Start the geometry kernel before you create this object. See
Floorkit. - This object is live geometry. To save a building, write it in a building model.
Saved railings
In a building model, a railing is an entry in therailings list of a storey (BmRailing). It has a path or a host, not both.
pathis a list of[x, y, z]points in world coordinates. Eachyis the base of the rail, so a path can climb. A railing with apathkeeps that path: it does not follow a stair when the stair changes.hostnames a stair of the same storey:{ stairId, side, inset }.sideis'left'or'right'when you walk up.insetis the distance in metres from the side of the flight to the rail. The build makes the path from the stair, so a move, a reshape or a new layout of the stair moves the railing in the same step.
- A stair that hosts a railing cannot be removed alone. Delete in an editor removes the stair and its railings in one step.
Balusters and top rail
A saved railing can setbalusterSpacing (default 0.11 m), balusterSize (default 0.02 m) and topRail ({ width, height }, default 0.06 ร 0.04 m). The build uses them; a file without them builds the defaults.
balusterSpacingmust be 0.02 m or more andbalusterSize0.005 m or more. A smaller value, 0 or a value that is not a number is refused with its path and the value.
Draw a railing
In a plan editor,startRailingDrawing draws a railing by clicks, as the wall tool does, and saves it as one undo step. Enter or a double click ends the railing when it has two points or more. Backspace removes the last point. Escape saves nothing. The path is at the storey elevation plus baseOffset (default 0).
extends OPElement implements IShape, IPlaceable, PlanVectorExportable
Constructor
Rail base path (world coordinates). Segments may slope โ a stair-hosted railing follows the flight
nosings. The top rail runs
height above this path; balusters drop from the rail to it.Maximum clear spacing between balusters (m). Code: a 100 mm sphere must not pass โ the 0.11 m
default center spacing with 20 mm balusters keeps the clear gap at 90 mm.
Properties
Methods
editableSchema
getPhysicalParts
setHostPath
move
delta (world-space, meters).
rotate
angleDeg around axis (default Y-up), pivoted at anchor (default the elementโs own centroid).
getEvaluatedPath
setOPGeometry
getExportRoots
toDrawing
toReachingDrawing
setOPMaterial
getEditAnchors
applyEditAnchor
getOPConfig
setOPConfig
beginEdit
beginEdit before endEdit keeps the first start.
endEdit
dispose
Types
RailingOptions
EvaluatedRailingSegment
RailingPlanDrawingOptions
double draws both faces of the top rail, one rail width apart; without a top rail, both faces of
the glass or of the balusters. Default single.RailArcs
The package does not export this type by name.RailingTopRail
ArcThrough
The circle of an arc froma through through to b; undefined when the three are on a line.
The package does not export this type by name.