# Hide specific Layer from panel

**URL:** <https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360>\
**Category:** Rhino Developer\
**Tags:** windows\
**Created:** [March 31, 2022, 5:07pm UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360 "2022-03-31T17:07:36Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![MatrixRatrix](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matrixratrix/32/529711_2.png) [@MatrixRatrix](https://discourse.mcneel.com/u/MatrixRatrix)\
**Post date:** [March 31, 2022, 5:07pm UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/1 "2022-03-31T17:07:36Z")

</div>

Hello ,

There is some way to hide a layer specific from Layers Panel ? ex:“Layer 04”.

![Hide Layer](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/e/6/5e6884c0b458bb21739a94797b781c4f20135df3.jpeg)

Thank you

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [March 31, 2022, 10:29pm UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/2 "2022-03-31T22:29:08Z")

</div>

Hi @MatrixRatrix,

I don’t know of any way - sorry.

Why do you want to hide a layer?

– Dale

---

<div class="post-metadata">

**Author:** ![Holo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/holo/32/496872_2.png) [@Holo](https://discourse.mcneel.com/u/Holo)\
**Post date:** [March 31, 2022, 11:20pm UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/3 "2022-03-31T23:20:32Z")

</div>

I have a code that hides the layer a given object is on. I’ll see if I can find it tomorrow.

---

<div class="post-metadata">

**Author:** ![MatrixRatrix](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matrixratrix/32/529711_2.png) [@MatrixRatrix](https://discourse.mcneel.com/u/MatrixRatrix)\
**Post date:** [April 1, 2022, 7:19am UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/4 "2022-04-01T07:19:05Z")

</div>

Hi @dale

Basically I’m making my own layer panel, I would like my layers not to  
be exposed in the rhino layer panel.

Thanks

---

<div class="post-metadata">

**Author:** ![MatrixRatrix](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matrixratrix/32/529711_2.png) [@MatrixRatrix](https://discourse.mcneel.com/u/MatrixRatrix)\
**Post date:** [April 1, 2022, 7:19am UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/5 "2022-04-01T07:19:44Z")

</div>

Hello @Holo ,

It would be nice if you could find it.

Thanks

---

<div class="post-metadata">

**Author:** ![Holo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/holo/32/496872_2.png) [@Holo](https://discourse.mcneel.com/u/Holo)\
**Post date:** [April 1, 2022, 9:46am UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/6 "2022-04-01T09:46:29Z")

</div>

Sure, here is a simple python script that I have in a button.  
And if you need it in Rhino Common then it is basically the same approach, get the layer some how and turn it off.

```python

!_-RunPythonScript (

### Hide objectlayer

import rhinoscriptsyntax as rs
obj = rs.GetObject("object to hide layer", preselect=True)
if obj:
    layer = rs.ObjectLayer(obj)
    
    if not rs.IsLayerCurrent(layer):
        rs.LayerVisible(layer, visible=False)
    else:
        print "object is on the active layer"

)

```

---

<div class="post-metadata">

**Author:** ![Holo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/holo/32/496872_2.png) [@Holo](https://discourse.mcneel.com/u/Holo)\
**Post date:** [April 1, 2022, 9:51am UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/7 "2022-04-01T09:51:10Z")

</div>

Oh, shoot, I just realized I missunderstood the topic, you want the layer to not be visible IN the panel, not turn it off… Suddenly the blue scribble made a lot more sense… Sorry for being so darn daft!  
Unfortunately I have no idea on how to do what you ask.

---

<div class="post-metadata">

**Author:** ![MatrixRatrix](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matrixratrix/32/529711_2.png) [@MatrixRatrix](https://discourse.mcneel.com/u/MatrixRatrix)\
**Post date:** [April 1, 2022, 10:14am UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/8 "2022-04-01T10:14:15Z")

</div>

@Holo

It doesn’t hurt and I appreciate the effort.

Thank you

---

<div class="post-metadata">

**Author:** ![Wiley](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/wiley/32/513037_2.png) [@Wiley](https://discourse.mcneel.com/u/Wiley)\
**Post date:** [April 9, 2022, 4:53pm UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/9 "2022-04-09T16:53:30Z")

</div>

You can create your own layer panel using eto form in python. And there you can have full control of what you would like to show.

---

<div class="post-metadata">

**Author:** ![MatrixRatrix](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matrixratrix/32/529711_2.png) [@MatrixRatrix](https://discourse.mcneel.com/u/MatrixRatrix)\
**Post date:** [April 9, 2022, 5:31pm UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/10 "2022-04-09T17:31:55Z")

</div>

> [@Wiley](#):
>
> You can create your own layer panel using eto form in python. And there you can have full control of what you would like to show.

@Wiley

I also remembered this, but I would always have the default layer panel that could collide with my layer.

Maybe I can also overrride the default layer panel of rhino , but do not know if it would be the cleanest solution.

Thanks

---

<div class="post-metadata">

**Author:** ![csykes](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/csykes/32/485543_2.png) [@csykes](https://discourse.mcneel.com/u/csykes)\
**Post date:** [April 11, 2022, 6:54pm UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/11 "2022-04-11T18:54:24Z")

</div>

Why do you not want to not use visible Rhino Layers? Your panel could manage Layers in duality with the Rhino Layer panel, or are these layers specific to your plugin?

---

<div class="post-metadata">

**Author:** ![MatrixRatrix](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matrixratrix/32/529711_2.png) [@MatrixRatrix](https://discourse.mcneel.com/u/MatrixRatrix)\
**Post date:** [April 12, 2022, 9:04am UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/12 "2022-04-12T09:04:50Z")

</div>

> [@csykes](#):
>
> Why do you not want to not use visible Rhino Layers? Your panel could manage Layers in duality with the Rhino Layer panel, or are these layers specific to your plugin?

Hi,  
Layers don’t have to be necessarily hidden from the user, I just don’t want the user to be allowed to select or modify any property, and as far as I could go, I just couldn’t prevent the user from selecting the layer, with the selection he can delete the layer which would be very bad for my plugin.

Yes, these layers are specific to my plugin.

Thank you

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/498369_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [April 12, 2022, 9:27am UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/13 "2022-04-12T09:27:56Z")

</div>

Is there a way to script Layer filters?

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/8/6/f86e9a0d80e0633f6c3d0b69641a8f1bae740153.png)

---

<div class="post-metadata">

**Author:** ![MatrixRatrix](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matrixratrix/32/529711_2.png) [@MatrixRatrix](https://discourse.mcneel.com/u/MatrixRatrix)\
**Post date:** [April 12, 2022, 9:34am UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/14 "2022-04-12T09:34:33Z")

</div>

> [@martinsiegrist](#):
>
> Is there a way to script Layer filters?

@martinsiegrist

I was also looking for this, and with this function it solved my problem, but apparently there is no way.

---

<div class="post-metadata">

**Author:** ![mlukasz87](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mlukasz87/32/499536_2.png) [@mlukasz87](https://discourse.mcneel.com/u/mlukasz87)\
**Post date:** [April 12, 2022, 10:08am UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/15 "2022-04-12T10:08:40Z")

</div>

It may sound as stupid question, but do you really need to keep objects you want to hide in a layer? If you would not store them in Rhino file, but in Rhino session memory instead, then this problem would not exist. They could be displayed within a conduit.

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/498369_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [April 12, 2022, 10:40am UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/16 "2022-04-12T10:40:18Z")

</div>

Good question.

Yet I’m wondering why layer filters don’t seem to be scriptable?

---

<div class="post-metadata">

**Author:** ![MatrixRatrix](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matrixratrix/32/529711_2.png) [@MatrixRatrix](https://discourse.mcneel.com/u/MatrixRatrix)\
**Post date:** [April 12, 2022, 12:21pm UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/17 "2022-04-12T12:21:51Z")

</div>

> [@mlukasz87](#):
>
> It may sound as stupid question, but do you really need to keep objects you want to hide in a layer? If you would not store them in Rhino file, but in Rhino session memory instead, then this problem would not exist. They could be displayed within a conduit.

@mlukasz87

It’s not a stupid question,

I want to save the objects inside the .3dm file .

Maybe there is another way, but I also already have a lot of code developed for the layers that I would like to keep.

Or maybe look for another solution and redo the code, maybe it’s not bad at all.

Thanks

---

<div class="post-metadata">

**Author:** ![mlukasz87](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mlukasz87/32/499536_2.png) [@mlukasz87](https://discourse.mcneel.com/u/mlukasz87)\
**Post date:** [April 12, 2022, 12:39pm UTC](https://discourse.mcneel.com/t/hide-specific-layer-from-panel/140360/18 "2022-04-12T12:39:17Z")

</div>

It is possible to store plugin data in .3dm file. Your plugin could read it and recreate content after some event or command.

But yes this is different approach and may require a lot of changes in code.
