Native Bulk Element Deletion API#1344
Merged
Merged
Conversation
… changes made during dev
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a native bulk element deletion capability to the iModel native layer and exposes it through the Node addon/TypeScript API, including a specialized path for deleting DefinitionElements with dependency checks.
Changes:
- Added
deleteElementsanddeleteDefinitionElementsto the TypeScript native interface and N-API bindings. - Implemented bulk deletion in
DgnElements, including descendant expansion, code-scope FK safety checks, and bulk link-table cleanup. - Extended
DefinitionElementUsageInfoto support excluding a set of element ids during usage scans.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| iModelJsNodeAddon/api_package/ts/src/NativeLibrary.ts | Declares new native bulk deletion APIs in the TS surface. |
| iModelJsNodeAddon/JsInteropDgnDb.cpp | Parses JS arrays of ids and calls new native bulk deletion entry points. |
| iModelJsNodeAddon/IModelJsNative.h | Adds JsInterop declarations for bulk deletion. |
| iModelJsNodeAddon/IModelJsNative.cpp | Adds N-API instance methods and marshals failure-id results back to JS. |
| iModelCore/iModelPlatform/PublicAPI/DgnPlatform/DgnElement.h | Adds bulk-operation state on DgnElements and extends usage-info API/signature. |
| iModelCore/iModelPlatform/DgnCore/DgnElements.cpp | Implements bulk element deletion and definition-element deletion logic. |
| iModelCore/iModelPlatform/DgnCore/DgnElement.cpp | Skips per-element link-table cleanup during bulk delete (handled in bulk). |
| iModelCore/iModelPlatform/DgnCore/DefinitionElementUsageInfo.cpp | Adds optional “exclude ids” filtering to usage queries/scans. |
rschili
reviewed
Mar 5, 2026
…/iTwin/imodel-native into rohitptnkr/bulk-element-deletion
rschili
approved these changes
Mar 10, 2026
…/iTwin/imodel-native into rohitptnkr/bulk-element-deletion
…/iTwin/imodel-native into rohitptnkr/bulk-element-deletion
khanaffan
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
itwinjs-core: iTwin/itwinjs-core#9052
Fixes: https://github.com/iTwin/itwinjs-backlog/issues/1841