A set that contains element objects.
Namespace:
Autodesk.Revit.DB
Assembly:
RevitAPI
(in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Examples
Copy
C#
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);
Copy
VB.NET
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)
Inheritance Hierarchy
System
Object
Autodesk.Revit.DB APIObject
Autodesk.Revit.DB ElementSet
Autodesk.Revit.UI.Selection SelElementSet
Autodesk.Revit.DB APIObject
Autodesk.Revit.DB ElementSet
Autodesk.Revit.UI.Selection SelElementSet