IFClite TypeScript API
    Preparing search index...

    Class StoreEditor

    Index
    • Add a new entity to the store overlay. Returns a synthetic EntityRef with a freshly-allocated expressId; pass it back to other APIs (other addEntity calls, setPositionalAttribute, exporters) to reference the new record.

      Pass type as the canonical IFC EXPRESS PascalCase name (e.g. 'IfcRectangleProfileDef'). UPPERCASE STEP tokens are also accepted — both are normalized to the same internal form.

      Attribute conventions (mirrors EntityExtractor.extractEntity() output):

      • numbers → STEP integer / REAL literal
      • "#42" → STEP entity reference
      • "'literal'" or any plain string → quoted STEP string
      • ".AREA." (dot-wrapped) → enum
      • null / undefined → $
      • arrays → STEP list (a,b,c)

      Parameters

      Returns MutationEntityRef

    • Attach a property set to an entity via the property view, so it surfaces in the properties panel AND exports to IfcPropertySet — the single source the rest of the app reads (the panel doesn't resolve raw overlay entities).

      Parameters

      • entityId: number
      • psetName: string
      • properties: {
            name: string;
            type: PropertyKind;
            unit?: string;
            value: string | number | boolean;
        }[]

      Returns void

    • Attach a quantity set to an entity via the property view, so it surfaces in the properties panel (getQuantitiesForEntity) AND exports to IfcElementQuantity — the single source the rest of the app reads. Prefer this over emitting raw quantity / element-quantity entities, which the panel doesn't resolve.

      Parameters

      • entityId: number
      • qsetName: string
      • quantities: { name: string; quantityType: QuantityKind; unit?: string; value: number }[]

      Returns void

    • The entity's CURRENT IFC class — canonical, from whichever layer is authoritative: a pending retype, an overlay-created entity's authored type, or the source record's declared type — or undefined when the id is deleted or resolves to nothing at all. The one place a builder that takes "an id of a specific class" (e.g. bim.store.addCostValue's UnitBasis) checks what it actually got, rather than trusting the caller.

      Parameters

      • expressId: number

      Returns string | undefined

    • All overlay-created entities, in insertion order.

      Returns NewEntity[]

    • Look up the overlay record for a freshly-added entity.

      Parameters

      • expressId: number

      Returns NewEntity | null

    • The schema declared by the loaded model, if the store exposes it.

      Returns string | undefined

    • Whether an id resolves to a live source or overlay entity.

      Parameters

      • expressId: number

      Returns boolean

    • Re-scan the store and bump the express-id watermark if the store has grown since construction (e.g. after lazy index hydration or federating in another model). Cheap to call — MutablePropertyView keeps the high watermark, so re-seeding with a stale value is a no-op.

      Returns void

    • Remove an entity. Existing entities are tombstoned and skipped during export; overlay-only entities are forgotten. Returns false if the id is not known to the store or the overlay.

      Parameters

      • expressId: number

      Returns boolean

    • Stage one synchronous IFC edit; failure publishes no partial overlay (#4243). Prepare image/worker resources before calling this. Returned entity IDs are valid after success; the draft editor is detached after this callback.

      Type Parameters

      • T

      Parameters

      Returns T

    • Edit a named root attribute (Name, Description, ObjectType, …).

      Parameters

      • expressId: number
      • attrName: string
      • value: string

      Returns void

    • Change an entity's IFC class in place ("retype" / reassign class).

      The entity keeps its expressId, so its geometry, placement, representation and every IfcRel* reference (all keyed by #id) carry over unchanged. The STEP exporter re-lays-out the entity's attributes BY NAME against the target class's declared layout — mirroring IfcOpenShell's reassign_class. Best suited to compatible reassignments such as the building-element subtypes (IfcBuildingElementProxy ↔ IfcColumn / IfcBeam / IfcMember / IfcPlate / IfcWall) which share the IfcElement attribute layout.

      Returns false if the id is not known to the store or the overlay.

      Parameters

      • expressId: number
      • newType: string

        Target IFC class. PascalCase (IfcColumn) or the all-caps STEP form (IFCCOLUMN) — both normalize to canonical PascalCase.

      • Optionaloptions: { predefinedType?: string | null }
        • OptionalpredefinedType?: string | null

          Optional PredefinedType for the target class.

      Returns boolean

    • Edit a positional STEP argument on any entity by zero-based index. Use this for non-IfcRoot edits like IfcRectangleProfileDef.XDim where the attribute has no symbolic name.

      Parameters

      Returns void