Hello,
I need to gruop every object on his layer in a single gruop. (be carful: not in parents layers)
selcect object layer–>gruop
Do someone have a script?
Thanks,
Hello,
I need to gruop every object on his layer in a single gruop. (be carful: not in parents layers)
selcect object layer–>gruop
Do someone have a script?
Thanks,
This is not hard to do - but I don’t understand this:
Does that mean not to group anything that is on a top-level layer?
Every part in a layer must be gruop. That gruop will not gruoped with his parent layer.
It shouldn’t be a issue. Pretend you didn’t read it if you didn’t understand it.
So nobody should ask questions if they didn’t understand exactly what you want? Probably won’t get a lot of help with that attitude.
Here’s what I have, pretend you didn’t read it if you didn’t understand it.
"""Gets all objects on each layer and groups them (one group per layer)"""
import rhinoscriptsyntax as rs
layers=rs.LayerNames()
for layer_name in layers:
obj_ids=rs.ObjectsByLayer(layer_name)
if obj_ids:
#name the group same as the layer name
group=rs.AddGroup(layer_name)
rs.AddObjectsToGroup(obj_ids,group)
Yeah, sorry!
Thanks. It works!
What’s the best way to add “Group name from layer name” to this script?
And where is the “GroupName” shown in the UI? (Edit)
Thx
Not sure what the question is? The script does that, it creates a group that has the name of the layer and adds all the objects on the layer to the group.
Ah, so where (and I’m embarrassed to ask this) is the Group Name shown?
I can get a list with “SelGroup” but do I need to make/find an Eto Box of some sort (I’ve never used Eto) to have a UI Window for Group Names? Maybe this should be a diff thread…?
EDIT: Poking the @pascal bear
Hi Alan - re you looking for a modeless list of groups that is always avaialbe, or a one-time modal look at the group names, or?
-Pascal
I was originally wondering if I were being daft not being able to find the Group Names in one of my panels
My first need was to be able to see the Group Name somewhere in a panel when I select a group.
But something Like a callable and/or dockable “Group Panel” could be helpful.
SelGroup?
Hi @pascal
Quick ping to see if u had any time to think about a solution for this group names list?
I was looking at your wiki scripts page (I go back to it now and again, especially since I started scripting) and thought maybe using the Popup cPlane menu idea wld be a good way to show Group Names. Thoughts?
Thx
Alan