161
Mach4 Toolbox / Autoenable softLimitsOn() on startup.
« on: May 28, 2015, 03:43:08 AM »
1. Operator -> Edit Screen -> highlight wxMach on screen tree editor (top left side of screen) -> goto Properties (middle left side of screen) -> click events (lightning bolt) -> highlight Screen Load Script -> click on Ellipsis box to enter the mcLua editor
2. Create a global variable to count ie, myCounter = 0
--Start my code.
myAxisCount = 0
function myTotalEnabledAxis ()
local mInst = 0
local rc = 0
local inst = mc.mcGetInstance (mInst)
for i=0, 11 do
if mc.mcAxisIsEnabled (inst,i) == 1 then
myAxisCount = myAxisCount + 1
end
end
end
myTotalEnabledAxis ()
function setMySoftLimitsOn(myAxisCount)
local mInst = 0
local rc = 0
local inst = mc.mcGetInstance (mInst)
for i=0,myAxisCount do
mc.mcSoftLimitSetState (inst,i,1)
end
end
setMySoftLimitsOn(myAxisCount)
2. Create a global variable to count ie, myCounter = 0
--Start my code.
myAxisCount = 0
function myTotalEnabledAxis ()
local mInst = 0
local rc = 0
local inst = mc.mcGetInstance (mInst)
for i=0, 11 do
if mc.mcAxisIsEnabled (inst,i) == 1 then
myAxisCount = myAxisCount + 1
end
end
end
myTotalEnabledAxis ()
function setMySoftLimitsOn(myAxisCount)
local mInst = 0
local rc = 0
local inst = mc.mcGetInstance (mInst)
for i=0,myAxisCount do
mc.mcSoftLimitSetState (inst,i,1)
end
end
setMySoftLimitsOn(myAxisCount)