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:
Execute Rhino
Open the file
Draw a line
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.
dale
(Dale Fugier)
July 8, 2022, 6:51pm
2
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!
dale
(Dale Fugier)
July 11, 2022, 3:46pm
4
Hi @nick_chang ,
You can use VSCode if you are running Rhino inside of CPython.
Here’s a new toy for the python crowd.
You’ll need to have the Rhino 7 WIP installed on Windows.
This allows you to embed and get access to RhinoCommon from inside of CPython.
You must be running a 64-bit version of Python
You can use either Python 2.7 or Python 3.7
import rhinoinside
rhinoinside.load()
import System
import Rhino
# for now, you need to explicitly use floating point
# numbers in Point3d constructor
pts = System.Collections.Generic.List[Rhino.Geometry.Point3d]()
pts.Add(Rh…
– Dale
1 Like