Waiting for idle state after open


#1

Hi,

I have a small script what open 3dm file and save printscreen:

Dim objRhino 
Set objRhino = CreateObject(\"Rhino5x64.Application\")
If Not (objRhino Is Nothing) Then
	objRhino.Visible = True	
	Call objRhino.RunScript(\"_-Open $openPath\\$filename \", 0)
	Call objRhino.RunScript(\"_-Zoom A E\" , 0)		
	Call objRhino.RunScript(\"_-ScreenCaptureToFile $viewPathP\\$imgfilename.png _enter\" , 0)	
	WScript.Sleep 2500	
	Call objRhino.RunScript(\"_-Setview W T\" , 0)	
	Call objRhino.RunScript(\"_-Zoom A E\" , 0)	
	Call objRhino.RunScript(\"_-ScreenCaptureToFile $viewPathT\\$imgfilename.png _enter\" , 0)	
	WScript.Sleep 2500	
	Call objRhino.RunScript(\"_-Setview W L\" , 0)	
	Call objRhino.RunScript(\"_-Zoom A E\" , 0)	
	Call objRhino.RunScript(\"_-ScreenCaptureToFile $viewPathL\\$imgfilename.png _enter\" , 0)	
	WScript.Sleep 2500	
	Call objRhino.RunScript(\"_-Setview W R\" , 0)	
	Call objRhino.RunScript(\"_-Zoom A E\" , 0)	
	Call objRhino.RunScript(\"_-ScreenCaptureToFile $viewPathR\\$imgfilename.png _enter\" , 0)	
	WScript.Sleep 2500	
	Call objRhino.RunScript(\"_-Save _enter\", 0)		
	Call objRhino.RunScript(\"_-Exit\" , 0)	
	WScript.Sleep 2500
End If
Set objRhino = Nothing

But in some cases the image is blank. In possible the script is too fast & did not wait “Creating Meshes…” method after open. Has it any options to wait Idle state in rhino?

Thanks

Laszlo Szabo

Config: Rhino 5.14.522, Intel i7-6700, 16 GB RAM


(Dale Fugier) #2

Hi @SzaboLaszlo,

Once the model’s render meshes are generated, they won’t be re-generated just because the view changes. But, if the model is on larger size, then perhaps Rhino is not ready for a screen capture. So, you might consider putting your sleep statements before the call to run the screen capture command.

Does this help?

– Dale