2021 Class
Changes 0
C

ElementSet

Description:
A set that contains element objects.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.APIObject
    Autodesk.Revit.DB.ElementSet
public class ElementSet : APIObject, IEnumerable
ICollection<ElementId> selectedIds = uidoc.Selection.GetElementIds();

string info = "Selected elements:\n";
foreach (ElementId id in selectedIds)
{
    Element elem = document.GetElement(id);
    info += elem.Name + "\n";
}

TaskDialog.Show("Revit",info);
Name Return Type Description Inherited From
C ElementSet() None Initializes a new instance of the class
Name Return Type Description Inherited From
M Clear() None Removes every item element the set, rendering it empty.
M Contains(Element) bool Tests for the existence of an element within the set.
M Erase(Element) int Removes a specified element from the set.
M ForwardIterator() ElementSetIterator Retrieve a forward moving iterator to the set.
M GetEnumerator() IEnumerator Retrieve a forward moving iterator to the set.
M Insert(Element) bool Insert the specified element into the set.
M ReverseIterator() ElementSetIterator Retrieve a backward moving iterator to the set.
M Dispose() None Causes the object to release immediately any resources it may be utilizing. APIObject
Name Return Type Description Inherited From
P IsEmpty bool Test to see if the set is empty.
P Size int Returns the number of elements that are in the set.
P IsReadOnly bool Identifies if the object is read-only or modifiable. APIObject