Group Editing?

I use these four macros as ad hoc group editing. I wish Rhino has better solution for group editing, but this mostly works so far.

Open group for editing with other objects either locked or hidden:
'_invert _Lock _Pause _SelAll _Ungroup _SelNone
! _Ungroup _Pause _SelLast _Isolate

Close back up as group with other objects unlocked or unisolated
'_Selall Group Unlock SelNone
'_Selall Group Unisolate _SelNone

The problem I find here is that, Isolate doesn’t really work well with Macro. For example, I cannot add SelNone after it in the macro(I tried different ways, but never successful).
I understand Isolate is not a standalone command, rather is invert - hide.

However, I’d like to use Isolate - Unisolate so that when closing the group, it only shows what was visible right before the group editing (hiding other objects). If I use hide - show, it will reveal all objects that I still want hidden.

The macro set I have achieves that
! _Ungroup _Pause _SelLast _Isolate
'_Selall Group Unisolate _SelNone
, but I want to add SelNone at the end of the macro after Isolate. Could you please help with this? Sorry I’m not really sure if I’m making any sense.

Hello- you can try these scripts and see if they do anything for you -

OpenGroup.py (2.1 KB)
CloseGroup.py (1.1 KB)

If I did this right it should allow you to work normally within one or more groups while they are ‘open’ and then close any open groups. Group status hould survive a file save an close and re-open, if I remember right.
I don’t know if this solves any of the problems you have with your macros though. Isolate does not work well with macros - that is the nature of that command in the current state of things - would you want a sort of EditGroup thing that isolates the group, lets you mess around and then closes the group and restores normal visibility?

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

-Pascal

Thank you for your reply. I remember your scripts quite far back when I was searching for this question. I don’t think it does what I’m trying to do. The script doesn’t either lock or hide other objects. It’s very important (at least for me) for group editing to have the rest of the scene either locked or hidden, two types of group editing.

Probably you can already tell from the Macro what I’m trying to do with the group editing. The Macros I set up are good enough, but I don’t know how to include canceling selection (or SelNone) after
! _Ungroup _Pause _SelLast _Isolate

Right, so the answer to my question above is Yes…

-Pascal

Would that be possible?
with two options to have other objects locked or hidden. Once script/macro is run, deselect everything.

Probably you can already tell from the Macro what I’m trying to do with the group editing. The Macros I set up are good enough, but I don’t know how to include canceling selection (or SelNone) after
! _Ungroup _Pause _SelLast _Isolate

Hi,

I’ve made a script with the help of chatgpt that helps me ‘edit’ the groups by always locking the objects outside the groups. And so if in the rhino parameters the locked objects are greyed out, the objects outside the groups will be greyed out. It works with nested groups. It is possible to go back with the GroupOut script. And if you’ve opened lots of nested groups, you can go back to the beginning with the GroupOutAll script.

Any improvements or comments are welcome.

GroupIn.py (1.6 KB)
GroupOut.py (1.4 KB)
GroupOutAll.py (1.5 KB)

That’s great work .. Could you improve it so that when I enter a group, a bounding box appears around the inner groups, while leaving the individual parts without a bounding box? And the deeper I go into the groups, the inner groups get classified using bounding boxes. The bounding box should be as curves with specific color & dashed lines, and placed on a specific layer to make it easy to hide… this will make it easy to know what is in group and what is not.

After continuous use, I have noticed a few issues… (I will explain the solutions directly). You should add to the script that:

(GroupOut)
-If the Doc User Text is <0 or Null, do nothing and print: “You are out”.
-When “locked1” is unlocked, the code should clear any keys/values present in all elements.

(GroupOutAll)
-Whenever this script is used, it should clear any keys/values present in all elements and clear the “Doc User Text”.

(The Problems)
-When copying elements that have keys and values.
-When there are already some locked elements.
-When using the scripts while not inside a group.

You can verify this yourself, and then you will decide what needs to be modified.

-Hani