Shift layer using Alias or Keyboard Shortcut

Is there a way to do this? For example:
Alias: NextLayer
Macro: "layer below becomes current layer
Alias: PrevLayer
Macro *layer above become current layer

Thanks,
Paul

Hi Paul,

AFAIK it is not possible with macros, but the below script should do what you described.

Save it in some permanent location on your HD, then drag-and-drop into any Rhino viewport.
The _NextLayer and _PrevLayer commands/aliases should become available. Please note that if your next layer is a child of a parent layer that is not expanded, the script will automatically expand the parent layer.

PrevNextLayer.rvb (1.9 KB)

hth,

–jarek

Hi Jarek,

Thanks for this script! This is exactly what I wanted, but one thing I’ve noticed is that it has a lot of difficulty with parents and children. When I have a file with nested layers, the command seems to jump around the layer structure, seemingly randomly, and may skip layers altogether.

Best,
Paul

Hi Paul,

I tested it only on simple nested layers… Would you be able to share a file you have problems with? You could delete objects from it as long as the layer structure is kept. I can see what the problem is.

Best,

–jarek

Sure, so here’s my layer default layer structure. The area I was having trouble with was moving back and forth in the “Linetype” section
ComplexLayers.3dm (175.6 KB)

Thanks. I found the problem.
Please try this one:
PrevNextLayer.rvb (2.8 KB)

Works perfectly, thanks!!