GetRootId Method


Gets the id of the top-level link which this link is linked into.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2012

Syntax

C#
public ElementId GetRootId()
Visual Basic
Public Function GetRootId As ElementId
Visual C++
public:
ElementId^ GetRootId()

Return Value

The id of the top-level link which this link is ultimately linked under, or invalidElementId if this link is a top-level link.

Remarks

This function will always return the id of a top-level link, or invalidElementId. Given the link structure A -> B -> C, then calling this function on C will return A's id. Call GetParentId to get B's id.

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 →