Can we have an option to 'merge' layers?

Meaning, select all layers that want to be merged, and move all objects to one single layer. There could be an option to create a new layer or select an existing one.

Would be quite useful.

Hello- I imagine this could be scripted, it’s probably been done, but I’ll have a poke at it. It could handle locked and hidden objects that way as well.

-Pascal

1 Like

I have one here I made for someone quite awhile back… See if it does what you want.
MergeLayers.py (1.0 KB)

1 Like

Hey Pascal, thank you. Can I be a little picky? I think it would actually be more useful to have an option to merge ā€˜all identically named layers into a new one of that name’. Including all sublayers too.

So for instance if you have layers:

Blue House
.indows
.doors
.roof

Red House
.windows
.doors
.roof

Scrip would create

windows_unique.
doors_unique
roof_unique.

And put all objects in those.

Hello - would you expect the orignal layers to be deleted?

-Pascal

Hmm, yes, but I can run Purge after so not really required.

Well, poking around I found an existing Mergelayers script - prolly about the same as @Helvetosaur 's, maybe I even stole it, but for the sake of variety, here you go -

MergeLayers.py (1.2 KB)

The other one should also be possible.

I don’t know if this is it but maybe -

MergeIdenticallyNamedLayers.py (1.4 KB)
Testing is guaranteed cursory.
To use the Python script use RunPythonScript, or a macro:

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

-Pascal

1 Like

If merging layers is a goal of this post please see my other post