GetWorksetId Method


Get Id of the Workset which owns the element.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)

Syntax

C#
public WorksetId GetWorksetId(
	ElementId id
)
Visual Basic
Public Function GetWorksetId ( _
	id As ElementId _
) As WorksetId
Visual C++
public:
WorksetId^ GetWorksetId(
	ElementId^ id
)

Parameters

id
Type: Autodesk.Revit.DB ElementId
Id of the element.

Return Value

Id of the Workset which owns the element.

Remarks

Each element belongs to one and only one workset.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →