@dan rathbun said:
Components can contain nested Groups and other Components. The Components could be normal or dynamic.
If nested, you'll need to do a recursive search (make a search method that calls itself.)
Dan, I am an author of two exporters , I have learned it few years ago. š SU2Thea exports whole SU model hierarchy.
@adamb said:
You would need to follow the hierarchy all the way to the top to determine if any antecedent (parent) was hidden - and thus all subsequent children are hidden - to get the correct answer.
Basically it requires you to structure code as a recursive descent.. which runs counter to the definition.instances graph-like structure.
I do walk all the hierarchy from the very top till the last visible? entity. It works perfectly on all objects. SU2Thea exports everything fine except this door for example:
The door has several layouts of a door leaf defined. They are all being exported, because when I check e.definition.entities all return true although not all are being visible on a screen at the same moment in the same instance.
I guess I have to recognize whether I have a DC, then check which option has been chosen for the instance I investigate (probably an attribute) and then discard all faces in a definition that doesn't belong to the 'option' (I guess defined in an attribute of the instance again).
I hope that is easy to distinguish parts of DC definition that are optional. If it isn't obvious from attributes that a DC stores then.. it will be hit or miss.
@adamb said:
EDIT: as I'm writing this..are you saying hidden? and visible? are actually different?
I was asking Dan whether there is a difference, but I doubt. API Docs don't mention it.
I will dig into the issue. I just thought someone has already been there.