insertElement Method
Insert a new element into the iModel.
insertElement(elProps: ElementProps): string
@returns The newly inserted element's Id.
@throws IModelError if unable to insert the element.
@note For convenience, the value of elProps.id
is updated to reflect the resultant element's id.
However when elProps.federationGuid
is not present or undefined, a new Guid will be generated and stored on the resultant element. But
the value of elProps.federationGuid
is not updated. Generally, it is best to re-read the element after inserting (e.g. via IModelDb.Elements.getElementProps)
if you intend to continue working with it. That will ensure its values reflect the persistent state.
Parameter | Type | Description |
---|---|---|
elProps | ElementProps | The properties of the new element. |
Returns - string
The newly inserted element's Id.
Defined in
- core/backend/src/IModelDb.ts Line 1895
Last Updated: 13 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.