loadProps Method

Obtain the properties of a single element, optionally specifying specific properties to include or exclude. For example, IModelConnection.Elements.getProps and IModelConnection.Elements.queryProps omit the GeometryStreamProps property of GeometricElementProps and GeometryPartProps because it can be quite large and is generally not useful to frontend code. The following code requests that the geometry stream be included:

 const props = await iModel.elements.loadProps(elementId, { wantGeometry: true });

loadProps(identifier: string | CodeProps, options?: ElementLoadOptions): Promise<undefined | ElementProps>

@returns The properties of the requested element; or undefined if no element exists with the specified identifier or the iModel is not open.

@throws IModelError if the element exists but could not be loaded.

Parameter Type Description
identifier string | CodeProps Identifies the element by its Id, federation Guid, or Code.
options ElementLoadOptions Optionally includes or excludes specific properties.

Returns - Promise<undefined | ElementProps>

The properties of the requested element; or undefined if no element exists with the specified identifier or the iModel is not open.

Defined in

Last Updated: 16 April, 2024