New C++ Sample: SampleScripter


(Dale Fugier) #1

I’ve posted a new C++ SDK sample that demonstrates how to make your script running commands cancelable.

The sample is based on a question I received from a customer who had written a script running command, a command whose class derives from CRhinoScriptCommand and calls CRhinoApp::RunScript(), that scripts multiple Rhino commands. Users were having difficulty canceling the command because pressing the Esc key only canceled the currently running, scripted command, not the entire script runner command.

https://github.com/mcneel/Rhino5Samples_CPP/blob/master/SampleCommands/cmdSampleScripter.cpp

Enjoy!

– Dale


#2

Oke so If I would like to use this I would have to split my own runscript and run it individually?
after that check if the command was successful or canceled.


(Dale Fugier) #3

If you wanted to make you command cancel-able by the user - yes.