611
Mach4 General Discussion / Re: How to set an active tool offset.
« on: March 16, 2018, 04:09:33 PM »
This will work.
But I am still want to know if you are able to do this another way.
Here is the macro for proof of concept.
function m202()
local inst = mc.mcGetInstance()
local ActualTool = wx.wxGetNumberFromUser("What tool is in the turret?", "Tool # ","Current Tool", 1, 1, 6) -- Default, Min, Max.
local rc = ActualTool
if rc == -1 then
wx.wxMessageBox("Set the current tool to the actual tool.")
else
mc.mcToolSetCurrent(inst, ActualTool)
mc.mcCntlSetLastError(inst, "T" .. tostring(ActualTool) .. "0" .. tostring(ActualTool))
mc.mcCntlGcodeExecute(inst, "T" .. tostring(ActualTool) .. "0" .. tostring(ActualTool)) --This uses the Tool Number that was entered into the Dialogue Box and pieces together a T### Command real fast.
end
end --m202
if (mc.mcInEditor() == 1) then
m202()
end
But I am still want to know if you are able to do this another way.
Here is the macro for proof of concept.
function m202()
local inst = mc.mcGetInstance()
local ActualTool = wx.wxGetNumberFromUser("What tool is in the turret?", "Tool # ","Current Tool", 1, 1, 6) -- Default, Min, Max.
local rc = ActualTool
if rc == -1 then
wx.wxMessageBox("Set the current tool to the actual tool.")
else
mc.mcToolSetCurrent(inst, ActualTool)
mc.mcCntlSetLastError(inst, "T" .. tostring(ActualTool) .. "0" .. tostring(ActualTool))
mc.mcCntlGcodeExecute(inst, "T" .. tostring(ActualTool) .. "0" .. tostring(ActualTool)) --This uses the Tool Number that was entered into the Dialogue Box and pieces together a T### Command real fast.
end
end --m202
if (mc.mcInEditor() == 1) then
m202()
end