Adding options for my plugin in option panel


(Matthieu Arnold) #1

Hi,
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
        Get
            Return New MSW_OptionControl
        End Get
    End Property

End Class

Best regards


(Dale Fugier) #2

Hi @Matthieu_from_NAVINN,

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

SampleVbOptions.zip (12.7 KB)

– Dale


(Matthieu Arnold) #3

Thanks Dale, this is perfect!


(Matthieu Arnold) #4

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


(Dale Fugier) #5

Hi @Matthieu_from_NAVINN,

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

– Dale


(Matthieu Arnold) #6

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?


(Dale Fugier) #7

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


(Matthieu Arnold) #8

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


(Dale Fugier) #9

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

– Dale