Unable to open panel as sibling of Layer panel

Hello,

I have been trying to open a panel as a sibling of the Layers panel in Rhino, but the call to Panels.OpenPanelAsSibling always returns false. It is unclear as to why this method returns false, unless I missed this information in the documentation. The panel does open as expected when calling Panels.OpenPanel.

This is a .net6 wpf application and the TempView in the code below is an empty UserControl.

I am currently using Rhino WIP, 8.0.23164.14305
The project is referencing the following packages:
RhinoCommon 8.0.23125.12175-wip
RhinoWindows 8.0.23108.14305-wip

public class TestPanel : Command
    {
        public TestPanel()
        {
            Instance = this;
            Panels.RegisterPanel(
                MyPlugin.Instance, 
                typeof(TestPanelHost), 
                "Test", 
                System.Drawing.SystemIcons.WinLogo, 
                PanelType.System);
        }

        ///<summary>The only instance of the MyCommand command.</summary>
        public static TestPanel Instance { get; private set; }

        public override string EnglishName => "TestPanel";

        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
           var panelId = typeof(TestPanelHost).Guid; 
            if (!Panels.OpenPanelAsSibling(panelId, PanelIds.Layers, true))
            {
                Panels.OpenPanel(panelId, true);
            }
            return Result.Success;
        }
    }
    [Guid(MyPlugin.TestId)]
    public class TestPanelHost : WpfElementHost
    {
        public TestPanelHost() : base(new TempView(), null)
        {
        }
    }

I am unsure if this is a WIP bug or if this is the result of some misconfiguration, any help would be appreciated.

Hi Kegan, I have the same problem, it looks like OpenPanelAsSibling does not work, or it is expecting an unclear input. And I’m using the Rhino 8 Release.

But in case it can help you or any other having this problem, I found an alternative way to open a Panel into another Panel’s dock bar:

// OpenPanelAsSibling(panelId, PanelIds.Layers, true)

Guid dockBar = Panels.PanelDockBar(PanelIds.Layers);
if (dockBar != Guid.Empty)
{
	Panels.OpenPanel(dockBar, panelId, true);
}
1 Like