queryElementIdByCode Method
Query for the Id of the element that has a specified code. This method is for the case where you know the element's Code. If you only know the code value, then in the simplest case, you can query on that and filter the results. In the simple case, call IModelDb.queryEntityIds, specifying the code value in the where clause of the query params. Or, you can execute an ECSQL select statement. See frequently used ECSQL queries for an example.
queryElementIdByCode(code: Required<CodeProps>): undefined | string
throws IModelError if the code is invalid
Parameter | Type | Description |
---|---|---|
code | Required<CodeProps> | The code to look for |
Returns - undefined | string
The element that uses the code or undefined if the code is not used.
Defined in
- backend/src/IModelDb.ts Line 1675
Last Updated: 30 November, 2023