I have installed the new Elefront (I assume… ) so some components in your script are disabled when I open your file, but that should not make any difference
the main problem you are facing is that Groups are not a thing you can reference in GH, but are an attribute of an object
to better explain, when your parts (A) get Ungrouped (B) nothing is happening to the data tree, because Ungroup will just work on things you have grouped together inside GH with the Group component, and this is not the case
you can get which Group a given object lies inside with script (I assume) or with plugins, I don’t know if Elefront handles group, I’m used to deal with groups using Human ( Human | Food4Rhino )
by using Human, with the Object Attribute Component you can get a list of integers, one int for each object, which will indicate which object are inside the same group:
but here comes a new problem some of the objects you have referenced in Parts are inside a Group, and some are not
So I would do something very stupid and laborious (probably someone will come up with a smarter solution) where objects that don’t belong to a group are assigned a new integer to make them belong to a “new group”:
this way you can “rebuild” your Parts data tree, where objects are sorted by group, meaning that each branch contains objects that belong to the very same group (apart branch #6 that -we know- belongs to no group, but we wanted also those in our data tree so we had to put them somewhere)
at that point -in theory- you can perform any kind of operation on this new data tree, knowing how objects are subdivied (here for instance I get the layer name… but you can continue with your original definition from this point, we are just after the “Ungroup” component )
Ungroup_keep_association_inno.gh (18.4 KB)
one note: Parts geometries are not internalized: you need to also open the Rhino file to get all those group and Layer data