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.