File3dmGroupTable Get list of of objects in a group with OpenNURBS?

Hello,
I am currently using the File3dmGroupTable returned from doc.AllGroups in OpenNURBS. I can then access each Group using the FindIndex method. However, once I have a Rhino.DocObjects.Group, I am not seeing a way to list File3dmObject or IDs for members of the group.

Is there a way I can list members of a Group with OpenNURBs? Should I be using another approach here?

Best,
-Nate

Hi @archinate1,

A Rhino object stores it’s group memberships on it’s object attributes. So just walk through all of the objects in the 3dm file and find those that reference the group’s index.

Does this help?

– Dale

Hi @dale,
That make sense - although it seems an expensive operation to determine group items for all objects in a model.

It seems that a Group object would expose a property to list item IDs belonging to it rather than require the user to iterate and sort all objects in the model. It sounds like that is not the case?

-Nate

Hi @archinate1,

I’ve added methods, equivalent to RhinoCommon, to Rhino3dm (.NET). These will be available next week.

https://mcneel.myjetbrains.com/youtrack/issue/RH-55170

– Dale

Hi @dale
I am too looking for the same in Rhino3dm Python. Is there a plan to add this?
I see that when using Rhino3dm Python, and object does not have GroupIndex as one of its ObjectAttributes.

Hi @Devang_Chauhan,

There is ObjectAttributes.GetGroupList, as objects can belong ot more than one group.

Does this help?

– Dale

I believe, I can work with it. Thanks. However, as mentioned by Nate above this can be computationally expensive. It would be good have a method on Python side that provides access to objects on a Group.

Hi @Devang_Chauhan,

I’ve added your question to the pile.

https://mcneel.myjetbrains.com/youtrack/issue/RH3DM-123

– Dale

1 Like