Hi All,
So I’ve created a series of worksets through Dynamo from my spreadsheet, however is there no way of setting the default to hide/show in all views? I can’t seem to find any nodes which control this. - Or can element parameters be used!?
I’m aiming for a simple list.filter to filter those worksets with a show/hide value in excel before assigning the parameter value to the workset.
Thanks,
Dan
1 Like
I don’t think its possible.
Edit: Try the IsVisibleByDefault
option. It might just do what you need. It looks like 2 years ago I wasn’t fully aware of what that did.
2 Likes
I edited my original answer. Give that a try.
1 Like
For anyone still looking for the answer to this:
# Load Python Standard and DesignScript Libraries
import sys
import clr
# Add Assemblies for Revit API
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
# Import necessary classes from Revit API
from Autodesk.Revit.DB import *
# Import DocumentManager
from RevitServices.Persistence import DocumentManager
# Set the current document
doc = DocumentManager.Instance.CurrentDBDocument
# Use the FilteredWorksetCollector to get the worksets
worksets = FilteredWorksetCollector(doc).OfKind(WorksetKind.UserWorkset)
# Prepare empty lists for workset names and visibility status
workset_names = []
workset_visibility = []
# Get the names of all worksets and their visibility status
for workset in worksets:
workset_names.append(workset.Name)
workset_visibility.append(workset.IsVisibleByDefault)
# Assign your output to the OUT variable
OUT = workset_names, workset_visibility