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: string | Code, modelClass?: EntityClassType<Model>): undefined | T
@returns The sub-model or undefined
if the specified element does not have a sub-model or fails validation when modelClass
is specified.
@see getSubModel
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 - undefined | T
The sub-model or undefined
if the specified element does not have a sub-model or fails validation when modelClass
is specified.
Defined in
- core/backend/src/IModelDb.ts Line 1611
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.