Problem about Exit() Command doesn't work in specific document

Hello,
Recently I’m trying to run auto testing on Rhino, but it occurred some problem about exiting Rhino.
I do a really simple work for auto testing:

  1. Execute Rhino
  2. Open the file
  3. Draw a line
  4. Exit Rhino

As you can see in the video below, it shows different results in two cases, case “Srfm_B33536_Case10.3dm” can’t just exit Rhino normally.
And it always stuck in the save change dialog.


In my opinion, I think that is something wrong about this model, but I just have no idea.

The version I use for testing is Rhino7(SR16), and here is the sample code and tested file.
execute_rhino.py (1.7 KB)
single_test_rhino_srfm.py (543 Bytes)
Srfm_B33536_Case10.3dm (5.5 MB)
Srfm_Box.3dm (27.0 KB)

Hope it’s useful for solving this problem,thanks.

Hi @nick_chang,

To suppress the dialog, set RhinoDoc.Modfiied to false.

import scriptcontext as sc
sc.doc.Modified = False

– Dale

1 Like

Hi @dale , thank for your reply, I really appreciate that.

It seems that setting RhinoDoc.Modfiied to false is just like using rhinoscriptsyntax.DocumentModified(False)

But unfortunately, it doesn’t work and still stick in the saving change dialog.

Others, I found that it can close Rhino normally when I run PythonScript in Rhino.

Even though I didn’t set RhinoDoc.Modfiied to false, and just using rhinoscriptsyntax.DocumentModified(False).

Is it possible that some problem in using VS Code or something else? I have no idea.

And I’m wondering if there is any other method to solve this problem, thanks!

Hi @nick_chang,

You can use VSCode if you are running Rhino inside of CPython.

– Dale

1 Like