Change layer automatically to specific layer when drawing line

Hello
I am new to Rhino and love the program. I have a question and don’t know if it is possible to create a script or an alias shortcut for below question.

Is there a way to write a script/Alias for line or arc command to change the current layer to a specific layer before running the line command? For example if I am drawing a line, i want the layer (current layer) change to layer “Drawing” then pline command start automatically.
1- Current layer is set to layer 0
2- I type Polyline to start a drawing
3- Rhino first changes current layer “0” to layer “Drawing” - if layer “Drawing” doesn’t exist, create it then select layer “Drawing”
4- Run Polyline command
5- Start drawing on layer “Drawing”
6- When finished, change layer to previous layer “0”

Another example, If I am hatching an area,
1- Change current layer to layer “Hatch”
2- Run command hatch
3- when finished hatching set layer to previous layer

Thank you

Hi Fred -

! _-Layer Current "Layer 01" Enter _Polyline MultiPause Enter -Layer Current "Default" Enter

Insert the layer names to taste.

Ah- fly in the ointment is the V5 tag - Multipause does not exist in V5…

-Pascal

Amazing. Thank you very much. I’ll give it a try

Regards

Hi Fred - I’m afraid it will not work in V5. It needs ‘MultiPause’ which is a V6 thing.

You’ll need a script in V5… I’ll see if I can make something.

-Pascal

Hi Pascal

I ordered 2 new licenses for V6 so I keep your code and use it once i get my new Versions. I appreciate it if you can help with V5 (Current Version i am using)

Regards

Hi Fred - another way would be to change the layer after the fact - maybe better:

! SelLast -ChangeLayer "Layer 01"

You can run that right after any command that made something.

-Pascal

Pascal

Ok, your code works fine up until Multipause. I am fine with your first part of the code which changes the layer then starts the command. I guess i could create another Alias for the hatch command the same way. Thank you for your help

Regards