2024 Class
Changes 6
C

ElementId

Description:
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.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.ElementId
public class ElementId
Name Return Type Description
C ElementId(BuiltInCategory) None Create an ElementId handle with the given BuiltInCategory id.
C ElementId(BuiltInParameter) None Create an ElementId handle with the given BuiltInParameter id.
C ElementId(Int32) the Create an ElementId handle with the given 32-bit integer id.
C ElementId(Int64) None Create an ElementId handle with the given 64-bit integer id.
Name Return Type Description
M Compare(ElementId) int Compares two element ids.
M op_Equality(ElementId, ElementId) bool Determines whether these two ElementIds are the same.
M Equals(Object) bool Determines whether the specified is equal to the current .
M GetHashCode() int Gets the value of the id as hash code
M op_GreaterThan(ElementId, ElementId) bool Determines whether one element id is greater than another element id.
M op_GreaterThanOrEqual(ElementId, ElementId) bool Determines whether one element id is not less than another element id.
M op_Inequality(ElementId, ElementId) bool Determines whether these two ElementIds are different.
M op_LessThan(ElementId, ElementId) bool Determines whether this element id is less than another element id.
M op_LessThanOrEqual(ElementId, ElementId) bool Determines whether one element id is not greater than another element id.
M Parse(String) ElementId string represented. Parse the string representation of the id into a corresponding ElementId.
M ToString() string Gets a String representation of the value of the id.
M TryParse(String, ElementId%) bool Parse the string representation of the id into a corresponding ElementId.
Name Return Type Description
P IntegerValue int Provides the value of the element id as a 32-bit integer.
P InvalidElementId ElementId Get the invalid ElementId whose value is -1.
P Value long Provides the value of the element id as a 64-bit integer.