A set that contains element objects.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 23.0.0.0 (23.1.0.0)
Syntax
Examples

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)