Copy Layers Between Drawings

I had a quick question, hopefully the screenshot explains most of it. Not sure what the problem is. I like the idea of using your scripts. Thank you for your time.
image

Hello - that usually means the script is not loaded - try drag and drop of the rvb file onto Rhino.

-Pascal

Did that earlier and it worked. I was trying to run from a button I made on a tool bar.

Hi Erik - The simple way for a small script like this is to put the whole thing on a button like so:

! _-Runscript (Dim arrLayers, strLayer

arrLayers = Rhino.GetLayers("Select Layers")

If IsArray(arrLayers) Then

  For Each strLayer in arrLayers

    Call Rhino.Print(strLayer)

  Next

End If
)

-Pascal

There’s another way to do this now with Rhino 6 that avoids playing with scripts - put all the layers you want into an empty drawing (you’re probably strting with a template drawing, just delete all the entities), then insert that drawing into the one you want to add the layers to - insert as individual objects not as a block, and the layers appear at the bottom of the layers list. Any layers that are already in the drawing get the layer state of the inserted layers (eg if layer Default is off in the original drawing but on in the inserted drawing, it becomes on in the original drawing). I think in Rhino 5 and earlier, you had to have an object on each layer for that layer to come over.

Since I have not found any “smart” way how to copy layers between drawings and I am not really friendly with Rhino python scripts, I will describe in my opinion easiest way, how to copy layers between drawings WITHOUT copying junk data like block definitions, styles etc.

Create point/line/anything, select all layers (or just those, you want to copy), press rmb and select “copy objects to layer”. Now you can select created objects, copy them to clipboard and paste them into new drawing. This way you copy only layers and their properties. Only restriction is, layers you want to copy need to be turned on and unlocked.