Detail Layers Visibility RhinoScript

One of the issues we struggle with is detail layer visibility, which has made it impossible to adopt Rhino as our primary CAD system. When you have 20 layouts with 60 details, managing layer visibility in details becomes almost impossible. A simple layer visibility change in model space can affect visibility in lots of details. Saving layer states is buggy so that’s not a viable solution. A solution to this would be a RhinoScript that looks at all details’ layer visibility settings, then sets model space layer visibility such that each layer that is visible in any detail is visible in model space (and if not visible in any detail it is off in model space). Before I jump in and try to create a script, I’m hoping someone has already written one. Has anyone done this?

Of course the best solution would be the ability to ignore model space layer visibility in details, but as far as I know that option has yet to appear.

Hi @rhorsefield,

This is a known limitation with they way layer visibility works. In the future, we hope to disconnect model view layer visibility with that of layout/detail visibility.

There are currently no issues related to this in our issue tracking system. If you are having problems and have a repeatable way of demonstrating, we’d like to see it.

I’m a little confused by this, because if a layer is off in the model, then it is also off in all details. Perhaps I need some clarification on this.


– Dale

“I’m a little confused by this, because if a layer is off in the model, then it is also off in all details.”

This is exactly the problem. Correct me if I’m wrong, but a detail has two independently set layer settings: model space and detail space. Both have to be on to be seen in a detail. But if I go to model space or even another detail and
turn off a layer in model space, that layer is now not shown in EVERY detail, even if a detail has that layer on in its detail layer settings. Thus, changing model space layer settings any detail can affect every detail. What I’m suggesting is a stop-gap measure
until you can divorce the model and detail layers. The script would go through all details, identify which layers are intended to be on in
any detail based on detail-only layer settings, and then set model layers to match.



Hi @rhorsefield

Your one the right track. Each layer has a global visibility setting and can have per layout/detail visibility settings. When a layer is on globally, it can be turned off in one or more layouts/details. However, if a layer is off globally, then it is off everywhere including in layouts/details.

A number of users have expressed the wish of having the global visibility disconnected from the layout/detail visibility. In this scenario, the layer could be off globally but still be visible in layouts/details. There is a significant amount of plumbing changes to make this fix. I don’t see it happening in Rhino 7, certainly not in Rhino 6.

– Dale

Are you aware of a script that does what I discussed?



But does this solve your issue? It could then well be that turning on layers globally means it will screw up other details that were not supposed to see those layers. I think the safest is to do your layout work when all layers are on and then set the details layer state where needed. Or do you want to run this script per page, print the page and go to the next?

what exactly? I must say I don’t use it that often, but when I do it works.

It’s been a while that I’m waiting for a more convenient layout management.
Knowing that it won’t be part of version 7 pushed me to try something by my own.
I’m working on a python script which does 3 basic functions :

  1. When switching to layout space, model layer states are saved and every model layer states are then turned on.
    When switching to model space model, model layer states are restored.
    This way we clearly see detail space states.
    Note : To print, whether turn all model space layer on manually or be in layout space.
  2. When new layer is created, it is turned off in every details (detail space).
  3. If shift is down while the new layer button is pressed, it behaves “normally” and it leaves the new layer on in every details.

Notes :
It actually works on a Windows 10 x64 platform.
The shift key detection is windows dependent. Must be tested on Mac.
The code basically registers two events : RhinoView.SetActive and RhinoDoc.LayerTableEvent.

It seems to work for me so far.
Please feel free to give me feedback.

Regards. (3.9 KB)