Rhino autosave twice when I run this line of python code both in editor and inside button

rs.Command("_-ViewCapturetoFile " + "_Width=" + str(w) + " _Height=" + str(h) + " _Scale=1 _TransparentBackground=_" + str(t) + " " + capture_file_name)

Trying to batch view capture through rhino command, I’ve tried and the file will only autosave when this line of code runs, and will not autosave after I comment this line out.

Save file name ( Unit=pixels  Width=1853  Height=546  Scale=1  LockAspectRatio=No  DrawGrid=No  DrawWorldAxes=No  DrawCPlaneAxes=No  ScaleDrawing=No  TransparentBackground=Yes  NumberOfPasses=500  Browse ): _Width=4000.0
Save file name ( Unit=pixels  Width=4000  Height=546  Scale=1  LockAspectRatio=No  DrawGrid=No  DrawWorldAxes=No  DrawCPlaneAxes=No  ScaleDrawing=No  TransparentBackground=Yes  NumberOfPasses=500  Browse ): _Height=2000.0
Save file name ( Unit=pixels  Width=4000  Height=2000  Scale=1  LockAspectRatio=No  DrawGrid=No  DrawWorldAxes=No  DrawCPlaneAxes=No  ScaleDrawing=No  TransparentBackground=Yes  NumberOfPasses=500  Browse ): _Scale=1
Save file name ( Unit=pixels  Width=4000  Height=2000  Scale=1  LockAspectRatio=No  DrawGrid=No  DrawWorldAxes=No  DrawCPlaneAxes=No  ScaleDrawing=No  TransparentBackground=Yes  NumberOfPasses=500  Browse ): _TransparentBackground=_Yes
Save file name ( Unit=pixels  Width=4000  Height=2000  Scale=1  LockAspectRatio=No  DrawGrid=No  DrawWorldAxes=No  DrawCPlaneAxes=No  ScaleDrawing=No  TransparentBackground=Yes  NumberOfPasses=500  Browse ): "C:\Users\21648\Desktop\test_21e1-3.png"
Autosaving file as C:\Users\21648\AppData\Local\McNeel\Rhinoceros\6.0\AutoSave\test (199726) 
RhinoAutosave.3dm
Autosave succeeded
Autosaving file as C:\Users\21648\AppData\Local\McNeel\Rhinoceros\6.0\AutoSave\test (199726) 
RhinoAutosave.3dm
Autosave succeeded
Image successfully saved as C:\Users\21648\Desktop\test_21e1-3.png

You can see the the file will autosave twice before (or during?) the image saving action is carried out.

This is a batch view capture script I adapted from a script example on rhino official website and has been working no problem in R5, I’m worried that the autosave twice will significantly affect performance of this script when ran on much bigger files (100mb+). I couldn’t figure out why autosave is triggered let alone twice in a row, no matter how frequent I run the script, any idea?

I plan to use ETO to rewrite the setting input and perhaps it will help? I have no idea.

Thank you in advance!

Hi @Jun_Wang,

Odd - I’m not seeing any autosaving here when running your script in Rhino 6.8. What is your Autosave time set for? Do you have Autosave configured to save before running some commands?

If you don’t want to script the command, you can do something like this:

https://github.com/mcneel/rhino-developer-samples/blob/6/rhinopython/SampleViewCaptureToFile.py

– Dale

I’ve checked and my Always saved beore box is empty, today when I run the script it only autosave once every time ViewCapturetoFile command is called. I’ll looking into the example you provided, thanks alot!

I’ve discovered that it was autosaving because I was running the script from the Rhino python editor debugging tool, so I could only assume it’s part of the editor’s feature? Autosaving does not happen when ran from Rhino toolbar that links to the script.