Hiding all panels and toolbars

Hi,
I’m looking fora way to hide all toolbars and sidebars and panels for a super minimal Rhino experience.
I have looked here: Hide specific toolbar tab
And here How to hide tool bar in C# - #3 by kaicihuang

But it doesn’t seem to do what I want. Do you have any advice to how I can hide everything except the viewports?

You can use/script the Fullscreen command. Call with -Fullscreen to provide additional settings.

Edit: Here’s a recent GhPython example:

"""
Set up Rhino and Grasshopper for a fullscreen demo (e.g. show Remote Control 
Panel, turn off viewport titles/lock viewport, set unit, hide Grasshopper).
    Inputs:
        Setup: Run the component {item,bool}
        Geometry: Geometry to zoom select to {item,geometry}
    Outputs:
    Remarks:
        Author: Anders Holden Deleuran (BIG CPH)
        Rhino: 8.24.25251.22001
        Version: 250926
"""

ghenv.Component.Name = "SetupRhinoGrasshopper"
ghenv.Component.NickName = "SRG"

import Rhino as rc
import Grasshopper as gh
from System.Drawing import Color

# Get Rhino appearence setting, active viewport and Grasshopper plugin
ast = rc.ApplicationSettings.AppearanceSettings
atv = rc.RhinoDoc.ActiveDoc.Views.ActiveView
ghp = rc.RhinoApp.GetPlugInObject("Grasshopper")

# Set up Rhino/Grasshopper for live demo
if Setup:
    
    # Go fullscreen
    if not rc.RhinoApp.InFullScreen():
        rc.RhinoApp.RunScript("FullScreen",False)
        
    # Set top view
    rc.RhinoApp.RunScript("SetView World Top",False)
    
    # Show Grasshopper remote control panel
    if not gh.Instances.IsRemotePanelVisible:
        gh.Instances.ShowRemotePanel()
        
    # Turn off viewport titles/tabs and set background color
    ast.ShowViewportTitles = False
    ast.ViewportTabsVisibleAtStart = False
    ast.ViewportBackgroundColor = Color.White
    
    # Set active viewport properties
    atv.Maximized = True
    atv.ActiveViewport.ZoomBoundingBox(Geometry.GetBoundingBox(True))
    atv.ActiveViewport.ConstructionGridVisible = False
    atv.ActiveViewport.ConstructionAxesVisible = False
    atv.ActiveViewport.WorldAxesVisible = False
    atv.ActiveViewport.LockedProjection = True
    
    # Set unit to mm and tolerance
    rc.RhinoDoc.ActiveDoc.ModelUnitSystem = rc.UnitSystem.Millimeters
    rc.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance = 0.001
    
    # Hide Grasshopper window
    ghp.HideEditor()
    
# Turn things off again
else:
    
    # Return from fullscreen
    if rc.RhinoApp.InFullScreen():
        rc.RhinoApp.RunScript("FullScreen",False)
        
    """
    # Hide Grasshopper remote control panel
    if gh.Instances.IsRemotePanelVisible:
        gh.Instances.HideRemotePanel()"""
        
    # Turn on viewport titles
    ast.ShowViewportTitles = True
    
    # Set active viewport properties
    atv.ActiveViewport.LockedProjection = False
    #atv.ActiveViewport.ConstructionGridVisible = True
    #atv.ActiveViewport.ConstructionAxesVisible = True
    #atv.ActiveViewport.WorldAxesVisible = True
2 Likes

This is great. However, it works mainly for demo’s as you can just press escape and you are back. I would like to nuke the toolbars and panels.

Not if you set the DisableEscape flag. See:

3 Likes

I did not see this. This is awesome! Thanks

1 Like

I would still love to have a more explicit control of the individual toolbars and panels. Panels I can hide but I struggle with toolbars.

This is the state of my experimentation.
I get a GroupCount of 0 (Rhino 8) so I can’t get any groups, and I can’t hide the individual toolbars.

import Rhino
import scriptcontext as sc
import rhinoscriptsyntax as rs

sc.doc = Rhino.RhinoDoc.ActiveDoc

def HideAllToolbars():
    rs.EnableRedraw(False)
    for toolbar_file in Rhino.RhinoApp.ToolbarFiles:
        print(toolbar_file.Name)
        print(toolbar_file.GroupCount)
        print(toolbar_file.ToolbarCount)
        for i in range(toolbar_file.ToolbarCount):
            toolbar = toolbar_file.GetToolbar(i)
            print(toolbar.Name)
            #HOW TO HIDE!
HideAllToolbars()

for panel in Rhino.UI.Panels.GetOpenPanelIds():
    try:
        Rhino.UI.Panels.ClosePanel(panel)
    except:
        pass

sc.doc = ghdoc

Just tried running these rhinoscriptsyntax functions in the EditPythonScript editor:

import rhinoscriptsyntax as rs

names = rs.ToolbarCollectionNames()
if names:
    for name in names:
        rs.CloseToolbarCollection(name,True)

But this also doesn’t appear to do much. Found this YouTrack, which looks related, maybe..