Adding options for my plugin in option panel

I’m trying to add options for my plugin in Rhino option panel. I believe I must create a class inheriting OptionsDialogPage, but I get an error message concerning the constructor, and I can’t figure out how to do this. Any Idea?

 Public Class MSWOptionPanel
    Inherits Rhino.UI.OptionsDialogPage

    Public Overrides ReadOnly Property PageControl As System.Windows.Forms.Control
            Return New MSW_OptionControl
        End Get
    End Property

End Class

Best regards

Hi @Matthieu_from_NAVINN,

Looks like you are missing a default class constructor. Here is a sample that you can use a reference. (12.7 KB)

– Dale

Thanks Dale, this is perfect!

Hi Dale, any way to open the rhino options on my OptionsDialogPage from code?
(I’m hiding rhino menus in my skin)

Hi @Matthieu_from_NAVINN,

Just script either the _-Options or the _-OptionsPage command.

– Dale

Thanks @dale, I can’t script because its not from a Rhino Command, but I think I figured a solution: since the option page is actually a windows control, I just have to add it to a windows form.

I have another issue with this option page: when I first open the rhino options, it works fine. If I close them then re-open, my option page is blank. Any idea?

I don’t understand this comment. But if you have added a page to Rhino’s Options dialog and you want to display this page from your application, then just script the _-OptionsPage command using RhinoApp.RunScript.

– Dale

I thought Runscript had to run from a “script runner” command but it seems it’s not the case.

Do you have any Idea concerning the control not loading when opening for the second time? When I add my option control to a winform I don’t have this issue

Without any sample code, that I can run here, no.

– Dale