instances list of a storey.
Before you start
You have a building model with a storeyground. See Start a building. You also have the .op text of a block, for example floorkit/bathtub/1.0.0.op of the Floorkit block catalogue.
Give the block source
Anexternal-op asset names its .op file by a uri. Floorkit does not download the file. Give its text in assetSources, keyed by the uri, when you open the session.
asset-source-missing error that names the uri.
Add the asset and the block
add-asset adds the definition. add-element on the instances list places a copy. assetRef is the id of the asset. position is the center of the block in metres: x and z on the storey, y above the storey. Send both commands in one batch: one undo takes both back.
add-element only.
Move and turn a block
A block has no transform command. Sendreplace-element with a new position and, for a turn, a new rotationYDeg. A block turns about the vertical axis only.
Mirror a block
A negative X or Z scale mirrors the block.[-1, 1, 1] mirrors it from left to right in the same box.
- The scale has one size on all three axes, such as
[1.5, 1.5, 1.5]or[-1, 1, 1]. - Y stays positive, so the block stays upright. A zero is not a scale.
- The session refuses any other scale with a
bad-scaleissue at the path of the scale, for example[-1, 2, 1].
Save and open again
AProjectManager saves the .op text of each external asset in assetSources of the project file, keyed by its uri. Thus the saved text opens again with no other input.
build.assetSources wins over the saved one, and the next save keeps it.
Draw the blocks
A plan draws the plan symbol of each block. A section or an elevation draws the 3D body of each block, also a mirrored or scaled one.drawProjectView and exportProjectSheet build the model again with the sources saved in the project file. Sources that you pass in assetSources replace the saved ones.
- In a section, a block draws in projection with the projection pen. The section line does not cut it: there is no cut line and no poché. A block hides what is behind it.
- In a plan, a room label keeps off the blocks in the room where the room has space.
Rules
position.yis the height above the storey. The live block is at the storey elevation plus this height.ifcClassof the live block is the IFC class that the.opfile names inmetadata['ifc:class'], such asIfcSanitaryTerminal. It is undefined when the file names none.- An
embedded-opasset keeps the whole definition in the model, and needs no source. A definition that is not a valid block is refused asbad-asset-definition. remove-assetrefuses an asset that a block uses.- An inspector changes a block with
manager.replaceFields(liveId, patch). The keys arelabelName,placement.position,placement.rotation,placement.scaleandpropertySets.placement.positionis in world metres: itsysaves as the height above the storey. A rotation with an X or Z turn is refused.
Next
Cut a section
Draw the blocks in a section and an elevation.
OpenElement API
See the block definition and its fields.