How to create Eto panels

Hi,
I’ve tried to implement the panel creation from SampleCsEto\SampleCsEtoPanel from the Github samples but I seem to be missing something. I did use Panels.RegisterPanel(…) in the Plugin.OnLoad(…) method, but nothing seems to happen. The help file for the RegisterPanel method states that the panel will be instantiated in a panel container, but where exactly should I look for it?
Thanks in advance.

I am sucessfully registering panel during plugin OnLoad with code as below:

protected override LoadReturnCode OnLoad(ref string errorMessage)
{
  Panels.RegisterPanel(Instance, typeof(Views.MyPanel), "MyPanelName", Properties.Resources.MyPanelIcon, PanelType.PerDoc);

  return LoadReturnCode.Success;
}

You may need additional line of code to show it. Like line below in some command:

Panels.OpenPanel(Views.MyPanel.PanelId);

Thanks. Especially for the Panels.OpenPanel(...) suggestion. It did work in the end. It seems that the reason it wasn’t initially working was because the panel was defined in another project, and that its .dll was not detected to be part of the plug-in by Rhino. However, I still find it strange that it was failing silently.

Hi. Sorry to bring this up again. I have a very beginner question regarding creating panels. I too tried to follow the examples on ‘SampleCsEto\SampleCsEtoPanel’ from the Github samples. I created a new HelloRhinoCommon plugin using the Rhino plugin template. Then I created a new command in that project and copied the code from ‘SampleCsEto/Commands/SampleCsEtoPanelCommand.cs’ and I also created a new cs file and copied the code from ‘SampleCsEto/Views/SampleCsEtoPanel.cs’
However my new command doesn’t work in the plug-in and when in debug mode I get the error: “The panel type must have a constructor with a uint, RhinoDoc or no parameters
Parameter name: type”

Any Idea what may be going wrong here?

Thanks in advance.

This is a pretty specific error. Does your constructor have one of these?

– Dale

Thank you for the response Dale,

Indeed the constructor has a uint parameter exactly as was shown in the example. Hence my confusion.

When I click on details and expand the TargetSite tree I do find some errors sprinkled around. Not sure if that is normal or what could possibly be causing this problem.

-Haidar