ElementId
Description:
The ElementId object is used as a unique identification for an element within a single project.
The ElementId object is used as a unique identification for an element within a single project.
Remarks:
The Value within the ElementId is only unique with a single project. It is not unique across several projects. The Id can be used to retrieve a specific element from the database when needed. However ids are subject to change during an Autodesk Revit session and as such should not be retained and used across repeated calls to external commands. If a manner is needed to uniquely identify an element beyond this limitation then a shared parameter should be added to the element containing a unique identifier managed by the external application.
The Value within the ElementId is only unique with a single project. It is not unique across several projects. The Id can be used to retrieve a specific element from the database when needed. However ids are subject to change during an Autodesk Revit session and as such should not be retained and used across repeated calls to external commands. If a manner is needed to uniquely identify an element beyond this limitation then a shared parameter should be added to the element containing a unique identifier managed by the external application.
public class ElementId
| Name | Return Type | Description |
|---|---|---|
| ElementId(BuiltInCategory) | None | Create an ElementId handle with the given BuiltInCategory id. |
| ElementId(BuiltInParameter) | None | Create an ElementId handle with the given BuiltInParameter id. |
| ElementId(Int32) | None | Create an ElementId handle with the given integer id. |
| Name | Return Type | Description |
|---|---|---|
| Compare(ElementId) | int | Compares two element ids. |
| op_Equality(ElementId, ElementId) | bool | Determines whether these two ElementIds are the same. |
| Equals(Object) | bool | Determines whether the specified is equal to the current . |
| GetHashCode() | int | Gets the integer value of the id as hash code |
| op_GreaterThan(ElementId, ElementId) | bool | Determines whether one element id is greater than another element id. |
| op_GreaterThanOrEqual(ElementId, ElementId) | bool | Determines whether one element id is not less than another element id. |
| op_Inequality(ElementId, ElementId) | bool | Determines whether these two ElementIds are different. |
| op_LessThan(ElementId, ElementId) | bool | Determines whether this element id is less than another element id. |
| op_LessThanOrEqual(ElementId, ElementId) | bool | Determines whether one element id is not greater than another element id. |
| ToString() | string | Gets a String representation of the integer value of the id. |
| Name | Return Type | Description |
|---|---|---|
| IntegerValue | int | Provides the value of the element id as an integer. |
| InvalidElementId | ElementId | Get the invalid ElementId whose IntegerValue is -1. |