Jump to content

Check if Object is a Container


Recommended Posts

Hello,

I need to check if a object conatins other objects.

Therefore I wrote this function:

def isContainerObj (obj):
   return vs.FInGroup(obj) != vs.Handle (0) 

It works but vs.FInGroup will return a error Message to the console when the objects is no container.

Has someone a more elegant solution for this.

thanks

Edited by Patrick Winkler
Link to comment
  • Marionette Maven

What if you check the type of the object you're querying to see if it's a group or a symbol or another object type that could qualify as a container? That should let you know if it will have any "children".

Still a little clunky, but I'm sure there aren't many other object types that would qualify as a container.

Link to comment
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...