thanks for all of that. It is really helpful!
Strangely, my counting members strategy seems to be working
I am organising paths to be sent off for lasercutting. I am looking to collect all the objects in layer and arrange them in a rough ‘nest’. Many of these ‘objects’ are grouped collections of paths, and I want to make sure I move the whole group and an not the sub objects.
grplist = rs.ObjectGroups(obj_id)
biggestGroup = 0
for grp_id in grplist:
memberCount = len(rs.ObjectsByGroup(grp_id))
if memcnt >= biggestGroup:
topGroup = grp_id
biggestGroup = memberCount
This seems to work as I hoped, returning the group name that contains all of the curves that would be selected if you were to click on something in the Rhino window. I can use this to manipulate the whole group and find the bounding box etc.
Perhaps what I am looking for is not the ‘top group’, but this seems to work for me. It allows me to specify a sub-object and get all the other objects that are linked to it in the group, and that is all I need
I realise now this only works for me because of how I model. I don’t ever combine sub-objects from one group with another: I just make larger, all-encompassing groups, which is why this works for me.
In this context, the ‘top group’ is easy to calculate.