I am trying to programatically set tool table values. The following macro runs and returns a rc=0 and the pVal is what is passed but the tool table values do not change. Anyone have an idea as to what I am doing wrong?
function m6001(hParam)
if (hParam ~= nil) then
--mc.mcCntlSetLastError(inst, 'handle == ' .. tostring(hParam));
local inst = mc.mcGetInstance();
local pVal = mc.mcCntlGetLocalVar(inst, hParam, mc.SV_P)
local pFlag = mc.mcCntlGetLocalVarFlag(inst, hParam, mc.SV_P)
if(pFlag == 1) then
rc=mc.mcToolSetDataExDbl(inst,61,'ZOffset',tonumber(pVal))
wx.wxMessageBox(tostring(rc)..' - '..tostring(pVal))
else
mc.mcCntlSetLastError(inst, 'ERROR: P Falue required with M6001');
mc.mcCntlEStop(inst);
end
else
mc.mcCntlSetLastError(inst, 'ERROR: handle == nil');
end
end
if (mc.mcInEditor() == 1) then
m6001()
end
TIA
RT