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.
I couldn’t find a custom node for renaming worksets, but it’s possible since 2015 R2 with the WorksetTable.RenameWorkset method.
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * clr.AddReference('RevitNodes') import Revit clr.ImportExtensions(Revit.GeometryConversion) clr.ImportExtensions(Revit.Elements) clr.AddReference('RevitServices') 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) name = IN #rename workset in a transaction TransactionManager.Instance.EnsureInTransaction(doc) WorksetTable.RenameWorkset(doc,workset.Id,name); TransactionManager.Instance.TransactionTaskDone() 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?