Minimalist skin

Hi,
I’m trying to create a minimalist skin for rhino. The idea is to hide everything except my project panels and maybe one specific toolbar.

At the moment I have a few issues:
*I can’t figure out how to hide the toolbars
*I 'd like to test from the plugin if I am using the skin or not
*Rhino.ApplicationSettings.AppearanceSettings.CommandPromptPosition = ApplicationSettings.CommandPromptPosition.Hidden
does not seem to work (the command prompt is not hidden)

Here is my source code:

Imports Rhino.Runtime
Imports System.Drawing

Namespace MSP_Skin
    Public Class MyMSPSkin
        Inherits Rhino.Runtime.Skin
        Protected Overrides ReadOnly Property ApplicationName() As String
            Get
                Return "Mass Summary Project"
            End Get
        End Property

        Protected Overrides ReadOnly Property MainRhinoIcon() As Bitmap
            Get
                Return My.Resources.scale.ToBitmap
            End Get
        End Property

        Protected Overrides Sub OnMainFrameWindowCreated()
            Rhino.ApplicationSettings.AppearanceSettings.SelectedObjectColor = Color.LightSkyBlue
            Rhino.ApplicationSettings.AppearanceSettings.MenuVisible = False
            Rhino.ApplicationSettings.AppearanceSettings.CommandPromptPosition = ApplicationSettings.CommandPromptPosition.Hidden
            Rhino.ApplicationSettings.ModelAidSettings.GridSnap = False
            Rhino.ApplicationSettings.ModelAidSettings.Osnap = False

            'Close every panels except those from my plugin
            For Each ID As System.Guid In Rhino.UI.Panels.GetOpenPanelIds()
                If ID = New System.Guid("F6B7996B-C3E3-4686-A4ED-F66E81656FB1") OrElse ID = New System.Guid("DFF7C532-8C58-46A1-B721-F749350509A7") Then
                    Rhino.UI.Panels.OpenPanel(ID)
                Else
                    Rhino.UI.Panels.ClosePanel(ID)
                End If
            Next

            'Hide items with Rhino_DotNet.dll
            RMA.Rhino.RhUtil.RhinoApp.HideControlBars()
            RMA.Rhino.RhUtil.RhinoApp.HideToolBars()
            RMA.Rhino.RhUtil.RhinoApp.HideWindowBars()

        End Sub

    End Class

End Namespace

This should do it:

foreach (var f in Rhino.RhinoApp.ToolbarFiles)
  f.Close(false);
Rhino.UI.ToolbarFileCollection.MruSidebarIsVisible = false;
Rhino.UI.ToolbarFileCollection.SidebarIsVisible = false;

I am not sure this is possible. Why do you need to do this?

Instead of hiding and/or changing appearance settings in OnMainFrameWindowCreated, try doing it in OnEndLoadPlugIn. Here, Rhino should be up-and-running, which isn’t the case when the the mainframe is created.

– Dale

Thanks.
I changed my sub to OnEndLoadPlugIn and added your code to hide the toolbars but it still does not work.

Concerning the test from my plugin, it is because I don’t want the plugin to load automatically outside my custom skin. For that purpose, if I am not in my custom skin I will close my panels on the event RhinoDoc.CloseDocument (If not I will keep them open)

Hi, I just discovered that the toolbars are hidden only after I open a document. Does it help for my issue?

Hi Matthieu,

Regarding the detection of whether or not Rhino is running with a skin, I cannot see a way in RhinoCommon to detect this. I’ve added a to-do item for this:

https://mcneel.myjetbrains.com/youtrack/issue/RH-38133

As far a hiding toolbars, you might try adding my sample code to the OnLoad member of you Rhino plug-in.

– Dale

Thanks, I think It may be useful for people needing to deeply modify Rhino. In my case I want to create a light interface because my plugin is going to be used with a 10 inches windows tablet.

Concerning hiding the toolbar, I think I will do it from the plugin as you suggested.

Thanks for your help

Matthieu