Skip to main content
Use it to show a building that the user does not edit. For editing, use BuildingSession.

Import

Example

Notes

  • Start the geometry kernel first.
  • The root of the result is already a child of the parent that you give.
  • elementsById gives the element for an id in the model. sourceByLiveId gives the model id for a live element.
  • Read warnings after the build.
  • A door, a window or a hole that does not fit on its wall at its saved offset is drawn there without a hole. The build does not change the model. It gives the warning opening-does-not-fit: its openingFit gives the offsets where the opening fits and the nearest one. Move the opening to such an offset to remove the warning.
  • Call disposeBuildResult when you replace or remove the build.
  • Give the content of external assets in assetSources. The function does not download them.

Signature

Parameters

BuildingModel
required
THREE.Object3D
required
BuildOptions
Default: {}.

Returns

disposeBuildResult

Release a completed build after replacing it or closing its owner.

BmBuildError

Types

BuildOptions

boolean
Skip revalidation for a document already checked this tick.
boolean
Stamp storeyId/buildingId onto every element’s propertySet. Default true.
Record<string, string | OpenElementDefinition>
.op sources for the document’s external-op assets, keyed by their uri, as either a raw buffer or an already-parsed definition. Fetching is the CALLER’s pre-step so this function stays synchronous — the same split .opbase uses (OPBaseOptions.assetSources). An embedded-op asset needs nothing here.
Readonly<Record<string, BmColor>>
The colour of a mass part by its use, #rrggbb by use name, used for a part when neither it nor its mass has a color. Replaces MASS_COLORS_BY_USE whole; a use it does not list takes #a0b8c8. Pass it where the project is opened (ProjectManager build) so that the live build, the plan drawings and the sheets take the same colours.

BuildResult

THREE.Group
required
One group per build, already added to the parent, at identity — elements are in world coordinates.
Map<string, OPElement>
required
BuildingModel id -> live element, so a caller can edit without re-parsing the document.
Map<string, CompiledModelObject>
required
Saved basic geometry, kept separate from BIM elements and their exporter contract.
Map<string, BuildingSourceRef>
required
Live element ID -> authored BuildingModel identity and feature.
Map<string, THREE.Group>
required
Map<string, WallNetwork>
required
BmIssue[]
required
BuildingModelSpatialStructure
required

CompiledModelObject

Extend this discriminated union alongside BmModelObject.

BuildingModelSpatialStructure

The non-geometric ownership context returned by a BuildingModel build.

CompiledLineObject

A compiled line and its authored ownership, kept separate from BIM elements. The package does not export this type by name.
'line'
required
string
required
string
required
string
required
string
required
Vec3
required
Vec3
required
string
Saved #rrggbb stroke, independent of the live THREE material.
LinePrimitive
required

CompiledArcObject

A compiled circular arc and its world-space working-plane frame.

CompiledPolylineObject

A compiled open path with vertices in world XYZ coordinates.

CompiledPolygonObject

A compiled filled profile with rings in world XYZ coordinates.

CompiledRectangleObject

A compiled rectangle with its saved mode and projected world boundary.

CompiledCuboidObject

A native upright body and its authored footprint, with explicit saved ownership.

CompiledCylinderObject

A native circular body with explicit authored ownership and world placement.

SpatialStructureScope

Property-bearing owner in a BuildingModel spatial hierarchy.

SpatialStructureBuilding

Last modified on October 16, 2026