DeleteSubelements Method


Removes the subelements from the element.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2018

Syntax

C#
public bool DeleteSubelements(
	IList<Subelement> subelems
)
Visual Basic
Public Function DeleteSubelements ( _
	subelems As IList(Of Subelement) _
) As Boolean
Visual C++
public:
bool DeleteSubelements(
	IList<Subelement^>^ subelems
)

Parameters

subelems
Type: System.Collections.GenericIListSubelement
Subelements to delete.

Return Value

True if entire element was deleted, false otherwise.

Remarks

Depending on implementation for given element as the result, the element can be deleted - especially if after Subelement deletion there are no Subelement left. See also: IsModifiable.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException One or more subelements in subelems do not exist in the element. -or- One or more of the subelements subelems cannot be deleted.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsModificationForbiddenException This Element is an internal element, such as a component of a loaded family or a group type. -or- The document containing this Element is in Group Edit Mode, Sketch Edit Mode, or Paste Mode, and the element is not a member of the group, sketch, or clipboard. -or- This Element is a member of a group or sketch, and the document is not currently editing the group or sketch.

See Also