I am trying to get all the Views in a ViewSet, but I am getting an error saying “the managed object is not valid”. I’m not sure where I am going wrong as I have written it in C# the same way and no problems. Is this a Python thing? In C# I need to cast as view although in Python this doesn’t work and no matter what I do it won’t give me access to the View properties.
What i’m interested in is the code behind the “View Sheet Sets” node which is shown in the picture originally posted by Daniel_Woodcook. The node outputs the ViewSheetSet objects and their names.
Sorry to keep old topics alive and ask simple questions.
Should the code that @Kulkul posted be incorporated into @Daniel_Woodcock1 original post, or is it supposed to function on it’s own? If it needs to be incorporated into the original, where at?
sorry I tried it but something is not right, I get a warning
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 30, in
NameError: name ‘vs’ is not defined
import clr
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc= DocumentManager.Instance.CurrentDBDocument
app = DocumentManager.Instance.CurrentUIApplication.Application