Quote Originally Posted by bob la londe View Post
Here was my final solution:

Code:
code "m9"
code "m5"
code "g28"
tool = GetSelectedTool()
SetCurrentTool(tool)
code "g43 h" & tool
code "m1"
It does what I want for a fast easy tool change finally.

It stops the spindle and the coolant pump, goes to a safe tool change location, retrieves the T(x) value, and stores it in the variable "tool". (Tool 1, Tool 2, etc) Then it performs the Gcode G43 H(x) to set the tool offset. All that's left is for me to swap to the correct tool and press start.

There are still a few things I would like to figure out how to do. For one thing I never really found a good resource for the values, commands, language structure, etc for Mach 3 macros. I just pieced them together from bits and pieces found here and there. Another thing I would like to do is figure out how to "park" the machine at the end of a program. Basically raise the spindle to safe Z, center the table, and move it forward to make part removal faster and easier when a program completes. Maybe I'll add a park button to my program screen. I ran across references to that while I was researching M6 macros. Executing a macro from a screen button. Well, that is a task for another day.
... later.

So much for my simple elegant solution:

I am having some problems getting my mind wrapped around the tool offsets and the tool table. It seems simple, but doesn't seem to work for me. I am abandoning the G43 H(x) stuff for now.

Just going with this for now:

Code "m9"
Code "m5"
Code "g28"
Code "m1"