Keep association after ungrouping objects?

I do need to ungroup some geometries but also I do need to keep the original association between the ungrouped parts. In this case I do have some parts that are “Edges” and I do need to keep the association with the corresponding “parts” after ungrouping.

Right now, if I ungroup this parts I do only get a flat tree but I don’t know what “edges” correspond to what “parts”. (437.3 KB) (435.3 KB)

I didn’t have your plug-in for attributes but maybe these help:

2 ways: first one where there’s a red parameter (‘error’) is the lazy way lol - second one adheres to what you were doing but used ‘brep’ as search term instead for the text-matching.


1 Like

Thank you for your effort, unfortunately not what I do need. I don’t understand what this definition does. I do need to KEEP the association of different parts within the same groups after ungrouping. There it is a layer called “EDGES” inside of which are some BREPs and I do need this BREPs (not the edges of the BREPs) to be able to associate with corresponding part that they do correspond.

I put a 3dm file for better understanding.

Right now, if I ungroup all the groups, I don’t have any kind of reference which parts pertains to which group.

Ungroup_keep_association.3dm (2.1 MB)

1 Like

In Elefront Plugin Attach attribute component is there
i try to use that in such case
it might help you

Attach Attribute .gh (49.6 KB)

I do need to reformulate my question: How I can import groups of objects in Grasshopper and retain the association between the parts pertaining to the same group? Right now all the parts are just one list, mixed grouped and ungrouped parts.

Group nr. 1 it is composed of the parts at index nr. 1 and 15 from the top list. Group nr. 2 it is composed of items 4 and 14, etc.

1 Like

Wrap & Unwrap compnents are u looking for it

I have installed the new Elefront (I assume… :smiley: ) so some components in your script are disabled when I open your file, but that should not make any difference :+1:

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 :slight_smile: some of the objects you have referenced in Parts are inside a Group, and some are not :slight_smile:

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 :+1: ) (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 :+1:


Thank you. This is what I do need to achieve.