Get views from viewset?


#1

Hi all,

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.

I’m relatively new to Python, so still rough around the edges when it comes to syntax, but any help would be appreciated as I’m a little stumped. :slight_smile:

Cheers,
Dan


ViewSet Elements
#2

Try to use .append instead of .Add. It would be better if you pasted the code here. You can format it with the </> button.


#3


#4

Legend! Works a treat @Kulkul. Thanks for the very quick responses also!


#5

@Daniel,

Could you please share the code you used for your GetViewSets node?

Thanks in advance!


#6

What’s wrong with what is already shared?


#7

@Yna_Db,

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.


#8

It would be fair to start a related discussion and to show what you tried. You can link it to this topic like so:
Share-a-link-to-this-post
Thanks :slight_smile: