Grid is a live datum in the 3D scene. It is not saved in the project file, and it does not draw on a sheet or in drawProjectView. Use it to show a grid while you model.
To save a grid, add a grid line to BmBuilding.grids: an id, a label such as B, a start and an end in world [x, z] metres, an optional arc: { through } that makes the line the circular arc from start through that point to end, and bubbles (start, end or both, the default). Edit the list with the add-building-element, replace-building-element and remove-building-element commands. Each command is one undo step and builds no storey again.
drawProjectView draws the saved grids:
- A storey plan draws each grid line dash-dot, with a circle bubble 8 mm across on the paper at each bubble end. A grid line with an
arcdraws as one arc, with each bubble along the arc’s tangent at its end. The label is upright. On a sheet at any scale the bubble keeps its paper size. - A plan view always draws all the grids of its building, also when it lists
elementIds. A grid id inelementIdsis accepted and changes nothing. - A section or an elevation draws each grid whose line, extended past its ends, crosses the view plane inside the crop: a vertical line with its bubble at the top of the crop, inside it. The bubble keeps its paper size at any sheet scale, and the line meets it. A grid along the view plane draws nothing.
duplicate-label. A grid line shorter than 1 mm is refused with zero-length-grid. An arc is checked as a wall arc is: a malformed one is refused with bad-arc, and a through point on the line from start to end with arc-collinear.
columnGridLocation(building, columnId) gives the grid location of a saved column, such as B-2: a lettered grid and a numbered grid that cross within 10 mm of the column centre, the lettered one first. The crossing must be on both grid lines, or at most 10 mm past an end; on a curved grid line it is on the arc, and the 10 mm are measured along it. snapToGrids snaps to the arc of a curved grid line, not to its chord. Two lettered or two numbered grids give no location. It gives undefined when no crossing is that close or the column has no centre.
Import
Example
Notes
- The editors have no grid tool yet. Add grids with the commands above.
- The IFC export does not write grids yet.
- A section or an elevation still cuts a curved grid line along its chord, from
starttoend. - A live datum lives only in the 3D scene. Save what a drawing must show in the building model or on a sheet.
extends OPElement implements IShape, IPlaceable
Constructor
Properties
Methods
editableSchema
rectangular
generateLabels
A, B, C, D, E, F, G, H, J, K, L, M, N, P, Q, ... (I and O skipped).
move
delta (world-space, meters).
rotate
angleDeg around axis (default Y-up), pivoted at anchor (default the element’s own centroid).
setOPConfig
getOPConfig
getEditAnchors
applyEditAnchor
setOPMaterial
setOPGeometry
getAxesSnapshot
columnGridLocation
The grid location of a saved column, such asB-2: a lettered and a numbered grid line that cross within 10 mm of the column centre, the lettered one first.