Revit 2025 API
Element |
A set that contains element objects.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
The ElementSet type exposes the following members.

Name | Description | |
---|---|---|
![]() | ElementSet | Initializes a new instance of the ElementSet class |

Name | Description | |
---|---|---|
![]() | IsEmpty | Test to see if the set is empty. |
![]() ![]() | IsReadOnly | Identifies if the object is read-only or modifiable. (Inherited from APIObject) |
![]() | Size | Returns the number of elements that are in the set. |

Name | Description | |
---|---|---|
![]() | Clear | Removes every item element the set, rendering it empty. |
![]() | Contains | Tests for the existence of an element within the set. |
![]() | Dispose | Causes the object to release immediately any resources it may be utilizing. (Inherited from APIObject) |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
![]() | Erase | Removes a specified element from the set. |
![]() | ForwardIterator | Retrieve a forward moving iterator to the set. |
![]() | GetEnumerator | Retrieve a forward moving iterator to the set. |
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object) |
![]() | Insert | Insert the specified element into the set. |
![]() | ReverseIterator | Retrieve a backward moving iterator to the set. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object) |

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);
Dim selectedIds As ICollection(Of ElementId) = uidoc.Selection.GetElementIds() Dim info As String = "Selected elements:" & vbLf For Each id As ElementId In selectedIds Dim elem As Element = document.GetElement(id) info += elem.Name + vbLf Next TaskDialog.Show("Revit", info)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also