Rename an existing Workset


Is there a way to rename an existing workset to a different name in dynamo? I’m wanting to rename the default “Shared Levels and Grids” workset to a different name within a graph I have created that creates worksets based on our company standards. Thanks for any help in advance.

Dynamo graph to rename existing worksets

I couldn’t find a custom node for renaming worksets, but it’s possible since 2015 R2 with the WorksetTable.RenameWorkset method.

import clr
from Autodesk.Revit.DB import *

import Revit

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

#Converting input from Dynamo to Revit

workset = UnwrapElement(IN[0])
name = IN[1]

#rename workset in a transaction



OUT = workset

How to rename the defaulf worksets? is it possible

Thanks. I knew it was in the API but I didn’t know enough about ironpython to implement it. Much appreciated.


Does this script accept lists if for example I want to batch rename worksets?

Or at least the 2 default ones?



Hi @Stavros_Koulis

Yes you can batch rename worksets. Read this how to handle list in Python Dividing parts with dynamo