delete_elements
Delete Revit model elements by ID. Use dry_run to preview deletions before applying. Cascades removals and reports failures for protected elements.
Instructions
Delete elements from the model, by element id.
Destructive. Prefer calling once with dry_run=True first: that returns exactly what would be removed without touching the model, which is worth doing whenever the ids came from a filter rather than from an explicit user selection.
Deleting one element can cascade - removing a wall also removes the doors and windows hosted in it - so deleted_count can exceed the number of ids supplied. The dry run cannot predict cascades.
Does NOT accept a category or a filter, only explicit ids: use reset_model for category-wide clearing, which has its own confirmation guards.
Elements that are pinned, owned by another user in a workshared model, or structurally required (such as the last level) cannot be deleted and are reported as failures.
Args: element_ids: Element ids to delete. Must be non-empty. dry_run: When True, report what would be deleted and change nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| element_ids | Yes |