IFClite TypeScript API
    Preparing search index...

    Class QueryBuilder

    Chainable query builder — collects filters, executes on terminal call.

    Usage: bim.query().byType('IfcWall').where('Pset_WallCommon', 'IsExternal', '=', true).toArray()

    Index
    • Filter by IFC class type(s)

      Parameters

      • ...types: string[]

      Returns this

    • Execute and return count

      Returns number

    • Limit result count

      Parameters

      • n: number

      Returns this

    • Scope query to a specific model

      Parameters

      • modelId: string

      Returns this

    • Skip first n results

      Parameters

      • n: number

      Returns this

    • Execute and return just EntityRef[] (no property data)

      Returns EntityRef[]

    • Filter by IfcOpenShell-style selector text — IfcWall, Pset_WallCommon. FireRating=2HR, Qto_WallBaseQuantities.NetVolume>1, etc. Parses via @ifc-lite/query's parseSelector and translates the AST to this builder's own byType/where shape (selectorToQueryDescriptor — see its doc comment for the exact lossless subset), so .select() cannot read a selector string differently than the CLI's --select flag or the MCP query_entities tool's selector param, which both call this same method rather than re-parsing.

      Appends into the same lists .byType()/.where() already append to, in either order — a selector's classes join descriptor.types (OR'd together by entities(), exactly like two .byType() calls: .byType ('IfcDoor').select('IfcWall') matches doors OR walls, not their intersection). The base class names remain unexpanded until execution, when each backend expands them against each model's own schema. Property comparisons join descriptor.filters (AND'd together, exactly like two .where() calls).

      Throws SelectorUnsupportedError (re-exported from this package) for any construct with no lossless target in QueryDescriptor — a regex pset/property name, !*=, ! class negation, + group unions, parent=, query:, an entity-attribute comparison, material=, classification=, location= — rather than silently running a partial or empty filter (the #4091 defect class). Also throws on a selector that fails to parse.

      Parameters

      • text: string

      Returns this

    • Filter by property value

      Parameters

      • psetName: string
      • propName: string
      • Optionaloperator: ComparisonOp
      • Optionalvalue: string | number | boolean

      Returns this