Close Linked Worksets of ACC model

Hi,

here a workaround (python)

code Updated

import clr
import sys
import System
#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

#import net library
clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

def manage_link_Worksets(rvt_lnk_inst, lst_wksetName_to_open):
    """
    open only the specified worksets in a linked Revit model,
    and reload the link using that configuration.

    Parameters
    ----------
    rvt_link_instance : Autodesk.Revit.DB.RevitLinkInstance
    workset_names_to_open : list of str
        Names of the worksets in the linked document that should remain open; all others will be closed.

    Returns
    -------
    Autodesk.Revit.DB.RevitLinkInstance
    """
    TransactionManager.Instance.ForceCloseTransaction()
    rvtRvtlinkType = doc.GetElement(rvt_lnk_inst.GetTypeId())
    linkdoc = rvt_lnk_inst.GetLinkDocument()
    worksetTable = linkdoc.GetWorksetTable()
    mpath = linkdoc.GetWorksharingCentralModelPath()
    lstPreview =  WorksharingUtils.GetUserWorksetInfo(mpath)
    worksetId_to_open = [worksetTable.GetWorkset(x.Id).Id for x in lstPreview if x.Name in lst_wksetName_to_open]
    #
    wkstConfig = WorksetConfiguration(WorksetConfigurationOption.CloseAllWorksets)
    lstWksetId = List[WorksetId](worksetId_to_open)
    wkstConfig.Open(lstWksetId) 
    load_result = rvtRvtlinkType.LoadFrom(mpath, wkstConfig)
    return rvt_lnk_inst

toList = lambda x : x if isinstance(x, list) and not isinstance(x, (str, System.String)) else [x]

lst_rvtLinkInstance= toList(UnwrapElement(IN[0]))
lst_wksetName_to_open = IN[1]

OUT = [manage_link_Worksets(lnk_inst, lst_wksetName_to_open) for lnk_inst in lst_rvtLinkInstance]