Help Close-Open panel python Script

Hi,
@Helvetosaur provided this great little python script which covers one click close and open of most of the panels.
Panel_OpenClose.txt (2.7 KB)

I’m trying to extend this script to include the “named cplanes” panel but I can’t figure out what Rhino.UI etc. its id is from. I’m new to python and I see the area he got the panelIds from but in that area there is no named cplanes id. He’s doing this list and I want to add the named cplanes ID to it. I see he got the GH panel in a different way.
Thanks for any help I’ve attached the full script above as well.

def PanelList():
a=Rhino.UI.PanelIds.ContextHelp #0
b=Rhino.UI.PanelIds.Display #1
c=Rhino.UI.PanelIds.Environment #2
d=Rhino.UI.PanelIds.GroundPlane #3
e=Rhino.UI.PanelIds.Layers #4
f=Rhino.UI.PanelIds.Libraries #5
g=Rhino.UI.PanelIds.LightManager #6
h=Rhino.UI.PanelIds.Materials #7
i=Rhino.UI.PanelIds.Notes #8
j=Rhino.UI.PanelIds.ObjectProperties #9
k=Rhino.UI.PanelIds.Rendering #10
l=Rhino.UI.PanelIds.Sun #11
m=Rhino.UI.PanelIds.Texture #12
#Grasshopper RCP ID
n=rs.coerceguid(“b45a29b1-4343-4035-989e-044e8580d9cf”) #13
return[a,b,c,d,e,f,g,h,i,j,k,l,m,n]

RM

If you open one of the floating panels from the menu, you can see it’s Guid from the command history.

The Guid for the Named CPlanes panel is 8f23551a-a05b-4a03-a8d5-3e2fc55e4d8a

So I think you would add it to the bottom of your function definition like this:

def PanelList():
    a=Rhino.UI.PanelIds.ContextHelp #0
    b=Rhino.UI.PanelIds.Display #1
    c=Rhino.UI.PanelIds.Environment #2
    d=Rhino.UI.PanelIds.GroundPlane #3
    e=Rhino.UI.PanelIds.Layers #4
    f=Rhino.UI.PanelIds.Libraries #5
    g=Rhino.UI.PanelIds.LightManager #6
    h=Rhino.UI.PanelIds.Materials #7
    i=Rhino.UI.PanelIds.Notes #8
    j=Rhino.UI.PanelIds.ObjectProperties #9
    k=Rhino.UI.PanelIds.Rendering #10
    l=Rhino.UI.PanelIds.Sun #11
    m=Rhino.UI.PanelIds.Texture #12
    #Grasshopper RCP ID
    n=rs.coerceguid("b45a29b1-4343-4035-989e-044e8580d9cf") #13
    #Named CPlanes ID
    o=rs.coerceguid("8f23551a-a05b-4a03-a8d5-3e2fc55e4d8a") #14
    return[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o]

Panel_OpenClose.txt (2.8 KB)

How are you running this script?

-Kevin

Hi @kev.r
That was brilliant. I didn’t think of looking in the command history for the panel ids.

I did add this bit of code
#keep the panels in the order you want the to appear
return[pl[14],pl[2],pl[5],pl[11],pl[10],pl[7],pl[9],pl[4]]
The last panel appears first when the panels are docked, i.e. pl[4] .

I’m running it off an icon.
That’s written in the text file, sorry I didn’t delete that. This way one can just copy the text file to an icon and run it.
Thanks for your help that worked perfectly and great suggestion to find the ids in the command history.
RM