IFClite TypeScript API
    Preparing search index...

    Class StyleNamespace

    bim.style — colour that ends up in the exported IFC.

    bim.viewer.colorize paints the current view; the colour is an overlay and is gone the moment the model is written out. This writes real IfcSurfaceStyle / IfcStyledItem entities, so the file opens coloured anywhere. Needs direct store access: the headless CLI and MCP contexts implement it; a backend without the store, including the browser viewer's, throws rather than silently doing nothing.

    bim.style.apply(bim.query().byType('IfcDuctSegment').refs(), '#9caec9');
    const ifc = bim.export.ifc(undefined, { schema: 'IFC4' }); // carries the colour
    Index
    • Colour several groups in one pass, the persistent counterpart to bim.viewer.colorizeAll. Batches are applied in order, so a later batch wins where two of them reach the same geometry.

      One call rather than a loop over apply: the "at most one IfcStyledItem per representation item" rule has to hold across the whole pass, and the index of already-styled geometry is built once instead of per batch.

      Parameters

      Returns ApplyStyleResult[]