Hi all,
I´d like to create a node where you can feed a list of Worksets and a list of View Templates.
This node will turn the visibility of the selected nodes to Hidden and the not selected to Visible just on the selected View Templates.
Unfortunately, I have no idea of Python
Researching on the internet I came across this other node (from Drew Jarvis at Cansel) which turns off the visibility of some workset on the active view only. I´d like to modify it so I can feed a list the View Templates instead.
Thanks for your help!
See the code below:
import clr
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
Workset = IN [0]
doc = DocumentManager.Instance.CurrentDBDocument
view = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument.ActiveView
coll = FilteredWorksetCollector(doc).OfKind(WorksetKind.UserWorkset)
TransactionManager.Instance.EnsureInTransaction(doc)
for ws in coll:
view.SetWorksetVisibility(ws.Id , WorksetVisibility.Hidden)
for ws in coll:
if ws.Name.Contains(Workset):
view.SetWorksetVisibility(ws.Id , WorksetVisibility.Visible)
TransactionManager.Instance.TransactionTaskDone()