Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

removing code for certain operation

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
sevenfive85
438 Views, 6 Replies

removing code for certain operation

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

6 REPLIES 6
Message 2 of 7


@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 Smiley Happy

 

 

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.


Message 3 of 7

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));

Message 4 of 7

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.


Message 5 of 7
sevenfive85
in reply to: sevenfive85

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.
Message 6 of 7


@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.


Message 7 of 7

THANK YOU LAUREN..

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report