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