Registering a panel in Rhino 8

Hi @dale,

What is the correct way to register a panel in Rhino 8? I am using the following. The issues I observed with it.

  1. After building the plugin, when I fire up Rhino for the first time, it freezes. Rhino might become usable on second or third try.
  2. When the panel is open in Rhino 8, if I open the layer panel and come back to my panel, it crashes rhino.
  3. The OpenPanelAsSibling does on work on the first load of Rhino.
using Rhino;
using System;
using Rhino.PlugIns;
using Rhino.UI;

namespace Wb.ModelEstablishment.Rhino
{
    public class ModelEstablishment_RhinoPlugin : PlugIn
    {
        public override PlugInLoadTime LoadTime => PlugInLoadTime.AtStartup;

        public ModelEstablishment_RhinoPlugin()
        {
            Instance = this;
        }

        public static ModelEstablishment_RhinoPlugin Instance { get; private set; }

        protected override LoadReturnCode OnLoad(ref string errorMessage)
        {
            Panels.RegisterPanel(this, typeof(Ui.FlightManual),
                "Flight Manual", Properties.Resources.Wombat);

            ShowDockedPanel();

            return LoadReturnCode.Success;
        }

        public static void ShowDockedPanel()
        {
            Guid panelId = Ui.FlightManual.Guid;

            if (!Panels.IsPanelVisible(panelId))
            {
                bool opened = Panels.OpenPanelAsSibling(panelId, PanelIds.Layers, true);
                RhinoApp.WriteLine($"The panel was opened: {opened}");
            }
        }
    }
}

System info

Rhino 8 SR15 2025-1-19 (Rhino 8, 8.15.25019.13001, Git hash:master @ 74164bdf5469c2f269746857c54b8c44b74c7b24)
License type: Commercial, build 2025-01-19
License details: Cloud Zoo

Windows 11 (10.0.22631 SR0.0) or greater (Physical RAM: 32GB)
.NET Framework 4.8.9290.0

Computer platform: LAPTOP - Plugged in [96% battery remaining]

Non-hybrid graphics configuration.
Primary display and OpenGL: NVIDIA RTX A4000 Laptop GPU (NVidia) Memory: 8GB, Driver date: 8-29-2024 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 556.35
> Integrated accelerated graphics device with 4 adapter port(s)
- Windows Main Display is laptop’s integrated screen or built-in port
- Secondary monitor attached to adapter port 1
Primary OpenGL: NVIDIA RTX A4000 Laptop GPU (NVidia) Memory: 8GB, Driver date: 8-29-2024 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 556.35
> Integrated accelerated graphics device with 4 adapter port(s)
- Windows Main Display is laptop’s integrated screen or built-in port
- Secondary monitor attached to adapter port 1

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
GPU Tessellation is: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU’s maximum)

Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 8-29-2024
Driver Version: 32.0.15.5635
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 8 GB

Rhino plugins that do not ship with Rhino
C:\Program Files\Chaos Group\V-Ray\V-Ray for Rhinoceros\V8\VRayForRhino.rhp “V-Ray for Rhino”
C:\ProgramData\McNeel\Rhinoceros\8.0\Plug-ins\Datasmith Rhino Exporter (d1fdc795-b334-4933-b680-088119cdc6bb)\DatasmithRhino8.rhp “Datasmith Exporter” 5.5.1.0
C:\Program Files\Enscape\Enscape.Rhino.Plugin-net48\Enscape.Rhino8.Plugin.dll “Enscape.Rhino8.Plugin” 4.2.1.88
C:\Bitbucket\wb.modelestablishment.prototype\Wb.ModelEstablishment.Prototype\Wb.ModelEstablishment.Rhino\bin\Debug\net48\Wb.ModelEstablishment.Rhino.rhp “Wb.ModelEstablishment.Rhino” 1.1.3.0
C:\Program Files\Common Files\McNeel\Rhinoceros\8.0\Plug-ins\ElefrontProperties (5db9285b-b408-41e2-b815-ed6ad84fd4a9)\1.0.0.0\ElefrontProperties.rhp “ElefrontProperties” 1.0.0.0
C:\Users\nycdvc\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\WombatRhino\1.0.5.24\WombatRhino.rhp “WombatRhino” 1.0.5.24
C:\ProgramData\McNeel\Rhinoceros\packages\8.0\LadybugTools\1.38.241\Ladybug.RH.Loader.rhp “Ladybug.RH.Loader” 1.38.241.0
C:\ProgramData\McNeel\Rhinoceros\packages\8.0\Pollination\1.54.3\Pollination.RH.Loader.rhp “Pollination.RH.Loader” 1.54.3.0

Rhino plugins that ship with Rhino
C:\Program Files\Rhino 8\Plug-ins\Commands.rhp “Commands” 8.15.25019.13001
C:\Program Files\Rhino 8\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Users\nycdvc\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\PanelingTools\2024.8.20.677\PanelingTools.rhp “PanelingTools”
C:\Program Files\Rhino 8\Plug-ins\RhinoRenderCycles.rhp “Rhino Render” 8.15.25019.13001
C:\Program Files\Rhino 8\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 8.15.25019.13001
C:\Program Files\Rhino 8\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 8\Plug-ins\MeshCommands.rhp “MeshCommands” 8.15.25019.13001
C:\Program Files\Rhino 8\Plug-ins\IronPython\RhinoDLR_Python.rhp “IronPython” 8.15.25019.13001
C:\Program Files\Rhino 8\Plug-ins\RhinoCycles.rhp “RhinoCycles” 8.15.25019.13001
C:\Program Files\Rhino 8\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 8.15.25019.13001
C:\Program Files\Rhino 8\Plug-ins\3dxrhino.rhp “3Dconnexion 3D Mouse”
C:\Program Files\Rhino 8\Plug-ins\Displacement.rhp “Displacement”
C:\Program Files\Rhino 8\Plug-ins\SectionTools.rhp “SectionTools”

Hi @Devang_Chauhan,

Use Panels.Open. I doubt Panels.OpenPanelAsSibling works in Rhino 8 - probably a holder over from the prior version’s docking system.

SampleCsEtoPanelCommand.cs

– Dale