Detect - on file open

check this (duplicate ? ) topic:

a Rhinocommon plug-in can subscribe to the events of RhinoApp and RhinoDoc
https://developer.rhino3d.com/api/RhinoCommon/html/Events_T_Rhino_RhinoApp.htm

https://developer.rhino3d.com/api/RhinoCommon/html/Events_T_Rhino_RhinoDoc.htm