getSubModel Method
Get the sub-model of the specified Element. See IModelDb.Elements.queryElementIdByCode for more on how to find an element by Code.
getSubModel<T extends Model<T>>(modeledElementId: string | Code, modelClass?: EntityClassType<Model>): T
throws IModelError if the sub-model is not found, cannot be loaded, or fails validation when modelClass
is specified.
see IModelDb.Models.tryGetSubModel
Parameter | Type | Description |
---|---|---|
modeledElementId | string | 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 - T
Defined in
- backend/src/IModelDb.ts Line 1447
Last Updated: 20 June, 2023