Delete layer and reassign the objects it contains to another layer?

Hi,

Is there a way to simply delete a layer and reassign the objects it contains to another layer?
(Keeping in mind that there may be objects in this layer present in several different blocks.)

Thank you in advance for your time,
Best,

Hello- if you right click on a layer in the layer panel and choose ‘Select Objects’ - assuming none are hidden or locked - you can then repeat on the target layer but choose ‘Change object layer’ You can do this from the layer panel or from the layer popup in the status bar.

image

Then delete the old layer.

Good enough?

-Pascal

If the layer had objects that were used to create block definitions then I don’t think this will work…

True. I don’t know what the context is… if there are block definitions involved it gets more complicated for sure.

-Pascal

I only mentioned this because his post said

A script that iterate through every object in the document and replace layer index from source to target layer… could work?
Then deleting the empty layer should be doable.

I’ve not tested but this is probably relevant:

Thank you all for your replies. I’ve just tried Karim’s script and it worked really well. So far I haven’t found any limitations with blocks.