Change layer automatically to specific layer when drawing line

rhino5
(Fred) #1

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

0 Likes

(Pascal Golay) #2

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

0 Likes

(Fred) #3

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

Regards

0 Likes

(Pascal Golay) #4

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

0 Likes

(Fred) #5

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

0 Likes

(Pascal Golay) #6

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

0 Likes

(Fred) #7

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

0 Likes