BUG or Feature? - Grouping Existing Group Creates Nested Group

Hello,

Is this a bug? :bug:

-Make some objects
-Run Group command
-Run Group command again

-Run Ungroup command (objects are not ungrouped)
-Run Ungroup command again (now objects are ungrouped)

I don’t remember this ever being like this?

In my mind running Group should only create another group if something is different… so if you take an existing group and then grab another object and run Group… that’s a new group.

But to have two objects that are grouped already and then run Group again doesn’t make sense to create a duplicate group, then nesting the two objects in a nested group.

This can be repeated indefinitely from what I can tell meaning Ungroup would have to be ran for as many times as the user grouped the same group if that makes sense haha.

Video showcasing the issue:

Thank you all!

Hi @michaelvollrath
I’m not to say if it’s a feature or a bug, but it’s been like that since grouping was introduced in Rhino. You can use UngroupAll to “kill” all levels of grouping in one go.
-Jakob

1 Like

grouping is horrible in rhino, if you re familiar with a similar concept of other apps.
it is not hierarchical or the groups are nested. A object can belong to several groups.

EDIT
3 groups - each black circle belongs to 2 groups.
;-(

I hope this clarifies it without additional irritation.

3groups.3dm (2.7 MB)

I would expect a pop-up when selecting a circle, that belongs to 2 groups.
the pop-up only shows if there are two objects below the click, not when there is one object belonging to two groups.

1 Like

Uh oh. Okay good to know! The UngroupAll is helpful. In most instances I would like to retain nested grouping though. So if two groups were inside of a third group I would want ungroup two expose the nested groups as it currently does. Just want to prevent a group from grouping itself over and over haha

Looks like I’ll need to implement some custom data or group tracking in my code to account for that.

I guess that’s okay as I’ll probably need it anyways.

Thank you @Normand and @Tom_P for your clarifications and examples!

forget about grouping.
userdata / userstring s is more powerful

userstring that start with “.” are invisible in the properties panel
.hiddenKey = SecretValue
;-D
(but not by the command GetUserText)

you can
_selGroup
… by name / group name
and than ungroup (“delete”) this single group.

1 Like

This is amazing I had no idea of this.

Likely I’ll implement some group id tracking with uuids.

Additionally, you can “group” by creating named selections.
-wim

1 Like

Thanks @wim , could you point me to the Rhinocommon API reference for that?
I’m not seeing anything about named selections in search.

Nope. Sound like this thread should have been in the Scripting category?
-wim

1 Like

I put it in Rhino as it was more of a “is this how Rhino groups work generally or a bug?” but we can move it if needed of course!

@michaelvollrath - There is no access to named selections vial RhinoCommon. I believe it’s on the to-do list.

– Dale

2 Likes

Understood, thank you for letting me know @dale !