queryAspects Method @beta

Stream the ElementAspect instances owned by a set of elements.

Use this method instead of calling IModelDb.Elements.getAspects repeatedly when reading aspects for multiple elements or when the result may be large. The query reads all requested owners together and yields each aspect without buffering the complete result set. For a single element with a small result, IModelDb.Elements.getAspects provides a simpler synchronous API.

The order is unspecified unless groupByOwner is true.

queryAspects(options: QueryAspectOptions): AsyncIterableIterator<ElementAspect>

@returns An async iterator over the matching aspects.

Parameter Type Description
options QueryAspectOptions Defines the element Ids, class filters, result ordering, and query connection.

Returns - AsyncIterableIterator<ElementAspect>

An async iterator over the matching aspects.

Defined in

Last Updated: 03 September, 2026