Using COG_AREA is one way, COG_BOX_SIZE is another that we typically use ... but either should work out ok.
Try moving
SetVariable "X_Value", xValue
SetVariable "Area_Value", areaValue
to AFTER you set the values and that should work much better. More like
cogArea = GetVariable("COG_AREA")
if cogArea = 0 then
SetVariable "X_Value", 0
SetVariable "Area_Value", 0
else
cogX = GetVariable("COG_X")
if cogArea < 3000 then
areaValue = 1
elseif cogArea > 3300 then
areaValue = 2
else
areaValue = 0
end if
if cogX < 150 then
xValue = 3
elseif cogX > 160 then
xValue = 4
else
xValue = 0
end if
SetVariable "X_Value", xValue
SetVariable "Area_Value", areaValue
end if
STeven.
|
|