I’d like to automatically close Rhino (and GH obviously) when my python script inside GH is done. Nothing difficult !
I use :
scriptcontext.doc=rh.RhinoDoc.ActiveDoc
rs.DocumentModified(False)
rs.Exit()
to close Rhino without being asked for saving, but I can’t find how to do the same for grasshopper which ask to save the modified file.
Rhino.RhinoApp.Exit()
Will close the Rhino that the grasshopper script is attached to.
It might prompt you to save grasshopper, no idea if you want to do that though.
for anyone wondering how to do that like me, I got rid of pop-ups on both Rhino and GH side using this:
var ghDoc = Grasshopper.Instances.ActiveCanvas.Document;
var rhinoDoc = Rhino.RhinoDoc.ActiveDoc;
if (close)
{
// Set document modified flags to both Rhino doc and GH doc to false
// That way we avoid pop-up windows when we try to close
rhinoDoc.Modified = false;
ghDoc.IsModified = false;
Rhino.RhinoApp.Exit(false);
}