yea because the list of structure for that code doesnt work with that. My final product is to open multiple documents and checkout worksets with a specific naming convention. If you just want to checkout workset in current opened document then the code below should work.
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import Element wrapper extension methods
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
# Import system library
clr.AddReference('System.Core')
from System.Collections.Generic import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
def ToList(x):
if isinstance(x,list):
return UnwrapElement(x)
else:
return [UnwrapElement(x)]
worksets = ToList(IN[0])
iDs = [ws.Id for ws in worksets]
Ids = List[WorksetId](iDs)
try: checkedout_ws = WorksharingUtils.CheckoutWorksets(doc,Ids)
except Exception,e: checkedout_ws = str(e)
OUT = checkedout_ws
I want to achieve the opposite, that all User Create Worksets are converted to non-editable. How do I do this, I have no experience with Phyton scipting. Who has a solution for this?
Yes, we discussed, I tried but still am getting errors so i attached file, can u check it and let me know. [Dynamo version 2.19.3] Workset project info.dyn (17.5 KB)