Remove elements from system.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)

Syntax

C#
public virtual void Remove(
	ICollection<ElementId> elementIds
)
Visual Basic
Public Overridable Sub Remove ( _
	elementIds As ICollection(Of ElementId) _
)
Visual C++
public:
virtual void Remove(
	ICollection<ElementId^>^ elementIds
)

Parameters

elementIds
Type: System.Collections.Generic..::..ICollection<(Of <(<'ElementId>)>)>
The elements to be removed from the system.

Remarks

It is forbidden to remove all terminal elements from system. Terminal elements will be removed from the system automatically after removing this system from document.

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentNullException Thrown when the input argument elements is nullNothingnullptra null reference (Nothing in Visual Basic), or any element in that collection is nullNothingnullptra null reference (Nothing in Visual Basic).
Autodesk.Revit.Exceptions..::..ArgumentException Thrown when some of the elements can't be removed, or when trying to remove all elements from the system. The element which connect to the base equipment can't be removed,
Autodesk.Revit.Exceptions..::..InvalidOperationException Thrown when the operation failed.

See Also