Is there a way to invert layer visibility with one click?

Hi,

I once saw in a tutorial video (and I hope it was a Rhino tutorial but cannot remember 100%) that the instructor could with one click + pressing a key (?) invert the visibility of his layers.

What I mean by inverting layer visibility:

Imagine you have several layers on/visible and you want to click on one layer, so this one stays visible while all others become hidden. So, it is like the Isolate command but for layers.

Is there such key combination or did the instructor used a custom command?

Thanks

You can create a macro and assign it to an alias or a keyboard shortcut

Turn all layers on:
! -Layer _On * Enter
Isolate the current layer:
!_-OneLayerOn Enter
Select an object to isolate the layer
!_-OneLayerOn _Select
the same with -OneLayerOff just remember to keep the hyphen to avoid the pop-up window

Macros are a great way to speed up the interface!

/José

Thanks José,

This could be a workaround.

I just tried this:
Isolate the current layer:
!_-OneLayerOn Enter

But when I run this command all layers get off, including the one I clicked on.

Hello - use -OneLayerOn SelectObject' if you want to pick an object on the layer to leave on, and OneLayerOn` to select a layer from the list. Note you can also select a layer in the layer panel and right click and choose ‘One layer on’ which seems to me to be the handiest way if you know the layer.

-Pascal

Thanks Pascal,

Yes, the right click ‘One layer on’ goes in that direction, but it also makes the visible layer “current”. Can the “make current” action be disabled?

Hello- that does not work with:

There must be one layer current and this cannot be off.

-Pascal

The current layer could stay active, it doesn’t have to swap to the now visible one.

So, you want all but one layer, plus the current layer, to be hidden…?

@phos4 - try this…

KindaOneLayerOn.py (930 Bytes)

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

-Pascal

Yes, exactly.

Thanks, will try it.

Pascal, the script works very well, thanks. Is there a way to avoid the pop-up:


and have the commad just run once I select a layer in the layer panel after pressing the script button?

Not quite the question you asked but I have found myself using the isolate command a lot.

Hello - yes, probably…

@phos4 - try the updated one above - if one or more layers are highlighted, they will be shown in addition to the current layer… all else, off. Could be kind of handy, actually.

-Pascal

Sure, I love that command and I use it all the time, but was looking for a similar solution for the layers.

That works very well, thanks again!