deleteDefinitionElements Method
Deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use EditTxn.deleteDefinitionElements instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
DefinitionElements can only be deleted if it can be determined that they are not referenced by other Elements. This usage query can be expensive since it may involve scanning the GeometryStreams of all GeometricElements. Since IModelDb.Elements.deleteElement does not perform these additional checks, it fails in order to prevent potentially referenced DefinitionElements from being deleted. This method performs those expensive checks and then calls delete if not referenced.
deleteDefinitionElements(definitionElementIds: Id64Array): Id64Set
@returns An IdSet of the DefinitionElements that are used and were therefore not deleted.
@see IModelDb.Elements.deleteElement
| Parameter | Type | Description |
|---|---|---|
| definitionElementIds | Id64Array | The Ids of the DefinitionElements to attempt to delete. To prevent multiple passes over the same GeometricElements, it is best to pass in the entire array of DefinitionElements rather than calling this method separately for each one. Ids that are not valid DefinitionElements will be ignored. |
Returns - Id64Set
An IdSet of the DefinitionElements that are used and were therefore not deleted.
Defined in
- backend/src/IModelDb.ts Line 2899
Last Updated: 06 May, 2026