tryGetSubModel Method

Get the sub-model of the specified Element. See IModelDb.Elements.queryElementIdByCode for more on how to find an element by Code.

tryGetSubModel<T extends Model>(modeledElementId: Id64String | GuidString | Code, modelClass?: EntityClassType<Model>): T extends Model | undefined

see IModelDb.Models.getSubModel

Parameter Type Description
modeledElementId Id64String | GuidString | Code Identifies the modeled element.
modelClass EntityClassType<Model> Optional class to validate instance against. This parameter can accept abstract or concrete classes, but should be the same as the template (T) parameter.

Returns - The sub-model or undefined if the specified element does not have a sub-model or fails validation when modelClass is specified.

Defined in

Last Updated: 18 November, 2020