I’m wondering if there is a method to move a collection of objects that are on various sublayers from one parent layer to another.
For example, I have modeled several objects on Shape 4 Details sublayers, but I want to move them all to the exact same sublayer tree under 04a Pilothouse.
The parent layers have the exact same sublayer structure, so it is just a matter of changing the parent layer name.
It may be that someone has developed a plugin or written a script to do this, but in the absence of such a tool you can only move the items on one layer at a time. Let us know if you want guidance on how to do that.
And just to clarify your intent:
The hierarchy under ‘Shape 4 Details’ has layers that don’t exist in the hierarchy under ‘04a Pilothouse’. If there are objects on, for example, ‘Outlines and Cutouts’ would you expect a layer of that name to be automatically created in the destination tree?
I have some coworkers that are RhinoPython wizards, I just didn’t want to overlook any obvious ways to do it with standard toolset before bothering them.
I keep running into the same issue. Changing the parent layer of objects, while retaining sublayers, would be very useful. Has anyone looked into this further?
I’m starting to think tags would be a good organizing alternative to layers and sublayers. Having endless duplicates of sublayers that want common properties gets messy. I’m using parent layers as an alternative to separate files, containing views or models, which then have common sublayers within them.
(If you were to move the contents of a folder to another folder, and lose the subfolder structure, this would be similarly annoying.)
Yes, I have the same issue with duplicated sublayers. I’m not familiar with Tags, is this something in Rhino? I’ve often thought that another organizational tool would be useful.
Do tags work like, you can tag an object as a ‘Door’, but have it on the ‘1st Floor’ layer?
@NeilE@jcparks - can you please post an example with two files: one with starting, and the other with the desired ending, states, that illustrates what you need to do?
Isn’t it possible to
1/ copy-paste the source parent layer with its sublayers and objects in another Rhino instance
2/ rename the parent layer to match the target parent layer
3/ copy-paste back in the original fil
4/ delete the original parent layer
@magicteddy Yes, that mostly works pretty well! I’ve recently complicated things by naming sublayers with their parent layer prefix - so I can actually see what layer is active in the top toolbar. So it wouldn’t work with different layer names.
This is really just a layer merging question. I found a script that can merge layers, but doesn’t deal with sublayers. There’s a similar query about merging sublayers here@Daniel_Krajnik.
Here’s an example file. I’d like to copy/move the geometry inside layer PL-02 to PL-01.
take one parent layer and all its sublayers and move the objects on those to layers in an existing set of layers that has the exact same structure, and layer names that correspond in some organized fashion to the orignal set…
Delete the orignal layers.
@NeilE . @jcparks - see how this works as a test - Note: it currently does no checking to see if the layer structures match, it just assumes they do… it works in your test file… also does not handle nesting deeper than one…
I’ve got the same problem.
I installed launched the PY.
Didn’t work
My (bad) parent layer name is xxx_rb_bad
The one you call “ask the user for the parent layer to merge.”
(prompt “Set layer name delimiter.\nLayer names to match after this character. Cancel or Esc for none.”)
My good parent layer name is xxx_rb
The one you call “ask the user for the ratget parent”
I 1st write xxx_rb_bad in the prompt
The list of layers are displayed
I select xxx_rb parent layer in dialog box
Clic OK
Does nothing
I couldn’t update my last post (to late)
So reposting
This is a must-have function
I’ve got the same problem.
I installed launched the PY.
Didn’t work
My (bad) parent layer name is xxx_rb_bad
The one you call “ask the user for the parent layer to merge.”
(prompt “Set layer name delimiter.\nLayer names to match after this character. Cancel or Esc for none.”)
My good parent layer name is xxx_rb
The one you call “ask the user for the ratget parent”
If found your other script “MergeLayers.py”
Does work partially
Should add prompts (for source and target)
eg. added to script MergeLayers_AKT.py (1.3 KB)
Partially because it will ONLY copy elements from one source layer to target then delete source (if empty)
But NOT when Source Entities are part of groups or blocks
The script should be called MoveFromSource2TargetLayer
Not Merge
Merging is merging
This “Merge” layer script Could have 3 options
Merge to Selected Target layer
Merge to Default Target layer (“Default” '“Layer_0” …)
Delete
This way it can remove any entities laying in Source to Default target and delete Source Layer.
An excellent way to get rid (purge) “polluting” layers.
Very often there are no entities directly set in a “Source” layer, but only entities nested into blocks or groups. You cannot get rid of this “Source” layer, unless you purge blocks and groups containing entities in this “Source” layer. But usually, you do NOT want to delete these blocks nor groups, and can’t afford to edit all blocks and groups to remove those entities manually.
SU has this function, when you right clic a layer and choose “Delete layer” It is very efficient.
3 options : Move to Current, move to default, delete…
Please let me know if feasible in PY.
I could aks some one…