Can't Set Worksets with Dynamo for Revit 2023

Has anyone tried to set worksets with the new Dynamo release that comes with Revit 2023?
I cannot set worksets anymore on a graph that worked in the past with ootb nodes…

Just returns nulls…

I would recomend you waiting for the first hotfix :slight_smile: 2023.1.0

I tend to agree with this sentiment, but, I do believe this is a result of the unit changes finally being done in this release.(The Building Coder: PDF Export, ForgeTypeId and Multi-Target Add-In)

I think the built-in set parameter by name node isn’t converting to whatever ForgeTypeId is needed for that node. (I am honestly a bit surprised that method ever worked because setting parameters by name for stuff like that has historically been buggy)

That being said, I would definitely report it on GitHub because they might be able to fix that on the Dynamo side of things.

If it were me, I would be using something that sets that parameter very specifically with the builtinparameter name as documented here, The Building Coder: Change Element Workset.

And clockwork does this really well:

“But I don’t want to Use Packages”

Also, doable in python (CPython3 script below)

# Load the Python Standard and DesignScript Libraries
import clr
from Autodesk.DesignScript.Geometry import *

# import Revit API
from Autodesk.Revit.DB import GraphicsStyle,ElementId,Element,BuiltInParameter

# import Dynamo Revit Services
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

# custom def for setting workset
def SetWorkset(element,workset):
    param = element.get_Parameter(BuiltInParameter.ELEM_PARTITION_PARAM)
    # set based on type
    if isinstance(workset, GraphicsStyle):
    elif isinstance(workset, ElementId):
    elif isinstance(workset, int):
    return element

# inputs
elements = UnwrapElement(IN[0])
workset = UnwrapElement(IN[1])

# return the results
if isinstance(IN[0], list): OUT = [SetWorkset(x,workset) for x in elements]
else: OUT = SetWorkset(elements,workset)

Hello all - as per 📢 Dynamo 2.13 - Revit 2023 Set Parameter Issue(s) - Hotfix Out Now this is now fixed in the Revit Hotfix, so please go download :partying_face:

1 Like