-- Set Z button --------------------------------------------------------------- -- Load modules --------------------------------------------------------------- local inst = mc.mcGetInstance() local profile = mc.mcProfileGetName(inst) local path = mc.mcCntlGetMachDir(inst) package.path = path .. "\\Profiles\\" .. profile .. "\\Modules\\?.lua;" .. path .. "\\Modules\\?.lua;" --TouchOff module package.loaded.mcTouchOff = nil local touch = require "mcTouchOff" mc.mcCntlSetLastError(inst, "luaTouchOffZNeg0:\n") -- touch.TouchZNeg() touch.TouchOffZNeg0() --Set Z button --local inst = mc.mcGetInstance() --local GageBlock = scr.GetProperty("droGageBlock", "Value") --local CurTool = mc.mcToolGetCurrent(inst) --Current Tool Num --local CurH = mc.mcCntlGetPoundVar(inst, 2032) --Current Selected H Offset --local CurHVal = mc.mcCntlGetPoundVar(inst, 2035) --Value of Current H Offset --local OffsetState = mc.mcCntlGetPoundVar(inst, 4008) --Current Height Offset State --if (OffsetState == 49) then -- CurHVal = 0 --end --GageBlock = tonumber(GageBlock) --local ZPos = mc.mcAxisGetMachinePos(inst, mc.Z_AXIS) --XVar, YVar, ZVar = GetFixOffsetVars() --local OffsetVal = ZPos - GageBlock - CurHVal --mc.mcCntlSetPoundVar(inst, ZVar, OffsetVal) --mc.mcCntlSetLastError(inst, string.format("Z Offset Set: %.4f", OffsetVal))