Notifications
Clear all
[Closed] Custom Attribute Properties in XRef Scene
Apr 29, 2014 9:46 pm
Assuming that ref is an XRefScene object, why can I only rarely get this to work:
whatIWant = for obj in ref.tree.children where isProperty obj "wantedPropertyFromCustomAttribute" collect obj
When I try to access some kinds of nodes (say a Text Shape with a Custom Attribute applied to it), I can not collect it with a query like that listed above. But other types of nodes will work.
[EDIT] When I open the XRef’ed scene directly, this query does work:
whatIWant = for obj in objects where isProperty obj "wantedPropertyFromCustomAttribute" collect obj
So the question is how to get a node in the xref no matter what the class is by checking for a property?
Any ideas?
1 Reply
Apr 29, 2014 9:46 pm
I have discovered the issue.
Only un-parented objects appear in ref.tree.children . It just happened that all of my Text objects were children of other objects. So to find them you need to recurse all children and their children, etc.