WorksetTableGetActiveWorksetId Method

Returns the active workset's WorksetId.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public WorksetId GetActiveWorksetId()

Return Value

WorksetId
WorksetId of the active workset.
Example
public Workset GetActiveWorkset(Document doc)
{
    // Get the workset table from the document
    WorksetTable worksetTable = doc.GetWorksetTable();
    // Get the Id of the active workset
    WorksetId activeId = worksetTable.GetActiveWorksetId();
    // Find the workset with that Id 
    Workset workset = worksetTable.GetWorkset(activeId);
    return workset;
}
See Also