deleteElements Method @beta
Delete multiple elements from the iModel in a single bulk operation.
Child elements and sub-model contents of the requested elements are deleted along with them.
The operation is all-or-nothing:
- On
Success, all elements (and their children / sub-model contents) were deleted. - On
ConstraintViolation, nothing was deleted and failures lists every element in the expanded delete set that is still referenced from outside the set, and why. Fix or include those referencing elements and retry. - On
DeletionFailed(an unexpected SQLite error) the iModel may be partially modified and the caller must abandon the current txn.
deleteElements(ids: Id64Array, _deleteOptions?: BulkDeleteElementsArgs): BulkDeleteElementsResult
@returns A result object describing the outcome of the operation and the elements that block it (if any).
@throws ITwinError if any of the supplied ids are not well-formed/valid Id64Strings.
| Parameter | Type | Description |
|---|---|---|
| ids | Id64Array | The ids of the elements to delete. All ids must be well-formed and valid Id64Strings. |
| _deleteOptions | BulkDeleteElementsArgs | Deprecated and ignored; kept for backward compatibility of the signature. |
Returns - BulkDeleteElementsResult
A result object describing the outcome of the operation and the elements that block it (if any).
Defined in
- backend/src/EditTxn.ts Line 492
Last Updated: 05 November, 2026
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.