Ok, I hope I understand now your approach.
It should be doable what you want to do if our parts are are build the same way.
You need to analyse all referenced files from a file.
If LDRAW_ORG type of a reference is PART you also have to analyse the next level and if it contains also SUBPART or PRIMITIVE it needs to be added to the bin.
Because we currently do not have any indication of the part to be flexible you have to carry a list of affected parts.
I hope you can understand what I am trying to say.
It should be doable what you want to do if our parts are are build the same way.
You need to analyse all referenced files from a file.
If LDRAW_ORG type of a reference is PART you also have to analyse the next level and if it contains also SUBPART or PRIMITIVE it needs to be added to the bin.
Because we currently do not have any indication of the part to be flexible you have to carry a list of affected parts.
I hope you can understand what I am trying to say.