I’m trying to create PyScript for open/close worksets.
In the beginning I collect worksets via Orchid with using name filters, than transfer it to my script. In the script I collect WorksetId and get it to WorksetConfiguration().Close(), but it not work.
Why it didn’t works?((
Thank you for reply!
Is it only for view? I need to close worksets in document, not in a view
Sorry mate, I use it in views, not for documents.
Are you try with an WorksetConfigurationOption ?
import System from System.Collections.Generic import List #rest of code # # create WorksetConfiguration with CloseAllWorksets by default wkstConfig = WorksetConfiguration(WorksetConfigurationOption.CloseAllWorksets) # open Wksets lstWksetId = List[WorksetId](wkset.Id) wkstConfig.Open(lstWksetId)
It’s currently not possible via the Revit API - the only thing you can do is define which worksets to open / close before you open a Revit document. That’s what WorksetConfiguration / WorksetConfigurationOption is used for but they will do nothing once the document is open.