ScriptSpot

Forum topic · Scripts Wanted

move selected objects to especific layer

By jsrocha · 2013-03-20

Description

Hi guys, how´s going?
i need a script to move selected objects to a specific layer (in this case, a layer named "**delete"). would be nice if the script create the layer if it does not exist.
Thanks in advance for any help.

Jsrocha

Comments (1)

Layermanager.newLayerFromName

MKlejnowski · 2013-03-27

Layermanager.newLayerFromName "__delete"
DelLayer = LayerManager.getLayerFromName "__delete"
For obj in selection do DelLayer.addnode obj

You can't use the "**" in a layer name. This should do the trick. Also you can't create multiple layers with the same name so it wont hurt to run the first line multiple times.