2025.3 Method
Changes 0
M

Document.Delete

Description:
Deletes an element from the document given the id of that element.
Remarks:
This method will delete the element and any elements that are totally dependent upon that element. Any references to the deleted elements will become invalid and hence cause an exception to be thrown if they are accessed. The elements will be deleted with no prompts for user confirmation. Pinned elements will be deleted with no warnings.

Note: in a family document, the predefined elements (those elements inherited from its family template file) can't be deleted by this method.

Overloads (2):
Delete(ElementId)
public ICollection<ElementId> Delete(
	ElementId elementId
)
  • elementId
    Id of the element to delete.
Return Value ICollection<ElementId> The deleted element id set.