WorksharingUtils.GetUserWorksetInfo on a closed file in Dynamo with Python?


#1

I’m trying to use WorksharingUtils.GetUserWorksetInfo on a closed model by passing a path string into a Python script. I can convert the path to a FilePath object as below:

worksetconfig

 

 

 

But when I uncomment and run with the highlighted line active, I get this error:

Exception: The Revit model specified by path doesn’t exist.

What am I doing wrong?


#2

Morning Luke,

That method is incredibly flaky - it has something like 10 different exceptions. Ideally, you’d want to use a try/except statement to prevent an exception from breaking down your whole code. Even more, you could import the python traceback module and capture the actual error message (this is a great trick that I learned from Konrad Sobon’s awesome work)

2015-09-29_09-46-44