OnUnloadPlugin? RhinoCommon


In the old SDK I called this method to save user preferences, does the OnShutdown method work the same way?


(Steve Baer) #2

Use the Settings property on your plug-in and command classes. Saving of preferences will automatically be handled by the framework. The Settings class is much smarter in that it knows about “defaults” and only stores non-default values for your plug-in in an XML file.


I guess I must not be using settings properly then, because I find if I don’t save them on close and load them on open they are not retained. I’m using them for the state of a check box or which radio button is active, etc… from one session of Rhino to the next

Do you have an example of the correct way to use settings? Am I missing something simple somewhere?


(Steve Baer) #4

Hmm… Are you using the Settings property that is on your plug-in and command classes or are you trying to create a new Settings class? If you use the Settings property everything should be saving and loading correctly, or this is a bu.


These are the settings you are referring to, correct?

(Steve Baer) #6

No, sorry those are not the settings that I was talking about. I was referring to a Settings class that we wrote and exists as properties on your custom plug-in and command classes


Ah OK, where can I see an example of that?

(Steve Baer) #8

I don’t think we have one at the moment. I’ll try to cook something up, but hopefully the class is self explanatory enough to just start typing on.