Rhino C# How to run code on rhino closing?

Hi there, I’m writing a plugin which requires some files to be saved when rhino closes. I assume I’d need to catch the closing RhinoApp event somehow, could anyone show me how to do this?

I’ve found this link while doing research about this, but I’'m not sure how to actually catch this event :confused:


The plugin class has “OnLoad” and “OnShutDown”
Just override those function in the main class from your plugin - this might do what you need ?


if you want to use RhinoApp.Closing event:
in c# you can subscribe with the += symbol and unsubscribe with -= symbol:

does this help ? kind regards - tom

1 Like

This was super helpful! Both of these solutions fix my issue perfectly.

Thanks for the help!