In my C++ plugin I am loading several RhinoScript procedures using RhinoApp().RunScript() at startup, for example I pass the following as a string to RhinoApp().RunScript():
-_RunScript (
Sub MyHelloWorld()
Rhino.Print "Hello World!"
End Sub
)
Afterwards I call these procedures from my plugin commands like this:
bool result = RhinoApp().RunScript(L"-_RunScript ( MyHelloWorld ))
This works perfectly well, I suppose this is also roughly the way the script compiler in Rhino 4 worked. There is just one thing I would like to achieve:
My question
How is it possible to prevent RhinoApp().RunScript being cancelled by the user using ESC?
Hi Dale, this certainly helps, at least it allows me to warn the user. I suspect blocking the ESC key might be possible using some C++ code, or is there absolutely no way?
Rewriting in C++ is not an option, however it would be very helpful if it were possible to create a snapshot of the Rhino-document at the beginning of the script, and roll back to it in OnCancelScript.