I am not positive, but I think there may be two different things going on here. You can be a borrower of an Element IN the workset, which can be seen through ToolTip info on the Element, but if you OWN a workset in it’s entirety there are no borrowers.
Yea makes sense - In this case, I couldn’t add a revision to a sheet because someone had the dialogue borrowed. I assume it would be the same principle for the manage links dialogue too.
As it’s not possible to return borrowers and I don’t think it’s likely that someone will ever own the revision settings element (curious how you forced this to be the case though @GavinCrump ?) I will just have to live with the error it will throw.
Ah I misinterpreted the intent so got the owner property of the workset vs borrower. This is usually a property of any workset kind, but it looks like archilab converts their workset objects to a custom archilab class instead.
import clr
import sys
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS
#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
#import net library
from System.Collections.Generic import List, Dictionary
#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument
app = uiapp.Application
currentUser = app.Username
elems = DB.FilteredElementCollector(doc).WhereElementIsNotElementType()
out = {}
for e in elems:
wksetstr = e.get_Parameter(BuiltInParameter.ELEM_PARTITION_PARAM).AsValueString()
# get worksharing info
wsu = WorksharingUtils.GetWorksharingTooltipInfo(doc,e.Id)
# get current owner if different
if wsu.Owner != "" and wsu.Owner != currentUser:
out[wksetstr] = wsu.Owner
dictBorrower = Dictionary[str, str](out)
OUT = dictBorrower