XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : help with coffee script?

10-31-2006, 05:50 AM
Writing a script in 9.6

I have an arbitray tool chosen and active. I run the following script

CallCommand X
(do this)
CallCommand Y
(do this)
CallCommand Z
(do this)

THe way the above script is written, after the script is run, tool Z will be the active tool after teh script has completed. However I want the original tool to remain the active tool.

How would I get the script to return back to the original tool that was active?

PLease bear in mind I'm a complete novice at any type of programming or coding. :sad:

10-31-2006, 06:04 AM
at the beginning of your script write this:

var tool = doc->GetActiveTool();
var id = tool->GetType();

then at the end of your script do


all this does is store the type of tool you're currently using, then it calls it back up at the end. so you're back to where you are. if you want to really not change tools at all, then you'd have to use the "SendModelingCommand()" instead.

10-31-2006, 06:19 AM
that did it!! Once again, thank you.

CGTalk Moderation
10-31-2006, 06:19 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.