Class Filter Expression

ECSQL allows filters by class

    <ECClassId>|<expr> IS [NOT] ( [ONLY] <qualified-classname-1> [, [ONLY] <qualified-classname-2>, ...])

Example

Try it yourself

Goal: Returns elements only if it's either of class GeometricElement3d, GeometricElement2d, or any of their sub-classes

ECSQL

SELECT * FROM bis.Element WHERE ECClassId IS (bis.GeometricElement3d, bis.GeometricElement2d

Try it yourself

Goal: Returns elements only if it's exactly of the specified classess - sub-classes are not included

ECSQL

SELECT * FROM bis.Element WHERE ECClassId IS (ONLY Generic.PhysicalObject, ONLY BisCore.LightLocation)

Try it yourself

Goal: Inverts the selection set

ECSQL

SELECT * FROM bis.Element WHERE ECClassId IS NOT (ONLY Generic.PhysicalObject, ONLY BisCore.LightLocation)

< Previous   |   Next >

Last Updated: 02 February, 2022