Parse Method


Parse the string representation of the id into a corresponding ElementId.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since: 2023

Syntax

C#
public static ElementId Parse(
	string idStr
)
Visual Basic
Public Shared Function Parse ( _
	idStr As String _
) As ElementId
Visual C++
public:
static ElementId^ Parse(
	String^ idStr
)

Parameters

idStr
Type: SystemString
The string representation of the id to return.

Return Value

ElementId string represented.

Remarks

If the string represents [!:Autodesk::Revit::DB::Element::InvalidElementId] it will be returned.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsInvalidOperationException Thrown when the string cannot be parsed into an ElementId.

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →