I would like to include the code to where if there is any lathe operation it would NOT output the G5 P10000. Can someone please help me? thank you
onCommand(COMMAND_OPTIONAL_STOP);
if (hasParameter("operation:strategy")) {
var strategy = getParameter("operation:strategy");
if (strategy != "drill"){ --------------------------------------------------------------????
writeBlock(gFormat.format(5), pOutput.format(10000));
}
}
writeBlock("G0G17G80G
Solved! Go to Solution.
Solved by Laurens-3DTechDraw. Go to Solution.
Solved by Laurens-3DTechDraw. Go to Solution.
@mapsymap wrote:
I would like to include the code to where if there is any lathe operation it would NOT output the G5 P10000. Can someone please help me? thank you
onCommand(COMMAND_OPTIONAL_STOP);
if (hasParameter("operation:strategy")) {
var strategy = getParameter("operation:strategy");
if (strategy != "drill"){ --------------------------------------------------------------????
writeBlock(gFormat.format(5), pOutput.format(10000));
}
}
writeBlock("G0G17G80G
This is an easy one
if(currentSection.getType() != TYPE_TURNING){ writeBlock(gFormat.format(5), pOutput.format(10000)); }
else{
writeBlock(gFormat.format(5), pOutput.format(0));
}
Laurens Wijnschenk
3DTechDraw
AutoDesk CAM user & Post editor.
René for Legend.
Just curious but what if I need a special type of code to be output only for certain type of tool path in that case what would I need?
Ex:
What if I need a Special code G12345 to be output only for let's say a 2d contour. What code would I need to have for it to output the code below without having to use a }else{ Or do we need the else for it to work?
---------------what code need to be on this line????
writeBlock(gFormat.format(12345));
You don't need the else.
You can take this part out and the code works as well:
else{ writeBlock(gFormat.format(5), pOutput.format(0)); }
But I made the assumption that it wouldn't hurt to make sure it's off for the other operations.
Laurens Wijnschenk
3DTechDraw
AutoDesk CAM user & Post editor.
René for Legend.
@mapsymap wrote:
I think I'm wording it wrong. What I mean is what if I want let's say
writeBlock(gFormat.format(12345));
To Only show up for ONLY LATHE operation.
If you want something only for turning operations do this:
if(currentSection.getType() == TYPE_TURNING){ writeBlock(gFormat.format(12345)); }
If you want something only for tapping operations for example do this:
if(hasParameter("operation:cycleType") &&
((getParameter("operation:cycleType") == "tapping") ||
(getParameter("operation:cycleType") == "right-tapping") ||
(getParameter("operation:cycleType") == "left-tapping"))){
writeBlock(gFormat.format(12345));
}
Laurens Wijnschenk
3DTechDraw
AutoDesk CAM user & Post editor.
René for Legend.