Querying Worksets

Use the Document Worksets component shared here to get all the available worksets in the active document.

Revit has lots of built-in worksets. It is always better to list the User Worksets only.

Document Worksets
Place under Grasshopper User Objects folder. Find in Revit > Custom panel

In Revit API, Worksets are represented by the DB.Workset. The worksets inside a Revit document are managed by an instance of DB.WorksetTable provided by the DB.Document.GetWorksetTable(). However, to create new worksets, use the DB.Workset.Create() method. Deleting worksets is much more complex as existing workset elements need to be moved to another workset before delete

Finding Specific Worksets

To find a workset by name or by id in the active document, use the Find Workset component shared here.

Find Workset
Place under Grasshopper User Objects folder. Find in Revit > Custom panel

Reading Workset Properties

Use the Workset Properties component shared here to extract important properties of a workset.

Workset Properties
Place under Grasshopper User Objects folder. Find in Revit > Custom panel

Active Workset

To find the active workset in active document, use the Active Workset component shared here.

Active Workset
Place under Grasshopper User Objects folder. Find in Revit > Custom panel

Setting Active Workset

To set the active workset in active document, use the Set Active Workset component shared here.

Set Active Workset
Place under Grasshopper User Objects folder. Find in Revit > Custom panel

Creating Worksets

To create a new workset in active document, use the Create Workset component shared here.

Create Workset
Place under Grasshopper User Objects folder. Find in Revit > Custom panel

Getting Element Workset

To find workset of an element, use the Get Workset component shared here.

Get Workset
Place under Grasshopper User Objects folder. Find in Revit > Custom panel

Setting Element Workset

To set workset of an element, use the Set Workset component shared here.

Set Workset
Place under Grasshopper User Objects folder. Find in Revit > Custom panel