I have not yet found a node or a python script example that allows me to export a list of worksets or Revit / AutoCAD links to Excel for model management purposes.
Does anyone know if this already exists?
If not, I am not sure how to find the syntax for workset (for example) that I could call to using a custom python node…
Just starting to learn about the custom python nodes and how to create these.
Hi there! Is anybody else noticing an issue with this ‘classic’ node Get Worksets in Dynamo 1.2.0?
I am getting an unrecoverable error… Clockworks package is offering a way to grab Worksets, but these are worksets by element, rather than file worksets.
I like Python- posthign this here for future reference- PY to get worksets in Revit - tweaked to add pairs of name + ID in output.
import clr
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
# Import RevitAPI
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
existWorksets = list()
##Get list of worksets filtered b user worksets only
fwc = FilteredWorksetCollector(doc).OfKind(WorksetKind.UserWorkset)
for ws in fwc: ##For each of the worksets:
Pair=list() #Container for list pair of name + ID
Pair.append(ws.Name) #Append Name
Pair.append(ws.Id) #Add ID
existWorksets.append(Pair) #Add pair to output
OUT = existWorksets