Filter by IFC class type(s)
Execute and return count
Execute and return first match or null
Limit result count
Scope query to a specific model
Skip first n results
Execute and return just EntityRef[] (no property data)
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.
Execute and return EntityData array
Filter by property value
Optionaloperator: ComparisonOpOptionalvalue: string | number | boolean
Chainable query builder — collects filters, executes on terminal call.
Usage: bim.query().byType('IfcWall').where('Pset_WallCommon', 'IsExternal', '=', true).toArray()