Hotkeys for layers?


#1

Hi! Is there a hotkey to switch between the layers? It would be great if I could hotkey like CTRL + 1 for black lines, CTRL +2 For furniture (grey) etc etc so it would be a lot quicker changing the layers. Also, if I had something marked and click ctrl + 2 it would be great if it could change layer. It is quite tidious now to first click properties, then click on the dropdown, search for the right later and THEN you have switched the item.


#2

–Edit-- Oops, sorry, missed the second part of your post, I’ll try and get to that in a bit. Below will at least handle the first part.

In Rhino Options -> Keyboard for each hotkey you wanted to make for a layer you could use

-_RunScript ( Rhino.CurrentLayer “LayerNameHere”)

obviously replacing with the name of the layer you want that hotkey to make active. If you are trying to get to a nested layer it would be:

-_RunScript ( Rhino.CurrentLayer “ParentLayer::ChildLayer”)

Sam


#3

Im having problems making that work. First I just copy pasted what you wrote and then it said “Invalid character”. Then I removed the spaces etc and now it says “Unknown command”.

What am I doing wrong?
(Thanks for the help btw!)


#4

Btw, to be more exact:
-_RunScript ( Rhino.CurrentLayer “LayerNameHere”)
Error; Invalid character
Line: 1
Char: 20


#5

I think Discourse is replacing the quote marks with fancy ones. If after you past it in, delete and replace the quotes, that seems to work here, or try coping this instead (lets see if this works better):

-_RunScript ( Rhino.CurrentLayer "LayerNameHere")

Sam


#6

Thanks! Got it working now, that is a useful shortcut, would be nice if I could pre-make layers so Furniture is always created with each new rhino-file and made grey, is that possible?

If you know how to change the current selected item to the layer x, that would be amazing. Would be nice to work with like 5 base layers with hotkeys for both changing the item (not solved yet) and making it current layer (solved).


#7

Yes, that is where template files are handy. You can set up a file exactly as you like, existing layers, current layer, dimension styles, titleblock, hatches, all that stuff, and save the file. Then in Rhino Options -> Files change the Default to the file you just saved.

If you have pre-selected objects, and hit you layer change hotkey, do you only want only the objects to switch layers, or do you also want the current layer to change?

Sam


#8

OK, try this:

ChangeLayer_170818_SP.zip (685 Bytes)

To get it working, unzip it, and note were you put the resulting *.rvb file. In Rhino Options -> RhinoScript, in Script files to load when Rhino starts, hit the new button (the square with the sparkle in the corner) and point it to where you unzipped the rvb and hit OK. This will only load the script when Rhino starts, so the script is not yet loaded. You can quit and restart Rhino to load the script, or you can use loadScript to load.

Once it is loaded, you would use

_noecho -_RunScript ChangeLayer "LayerNameHere"

(the _noecho just keeps it from cluttering the command line)
This version does not change the current layer if you have something selected. If you want to change that, open the rvb file using editScript and remove the ’ from the beginning of line 49, save, and reload the script using loadScript.

Hope that helps,

Sam


#9

Thanks so much for your time and dedication. I will check it out when I return to my main computer on tuesday (travelling)! I am sure it is great!