Manual Parameter NC - Comment

Manual Parameter NC - Comment

bflug
Contributor Contributor
617 Views
2 Replies
Message 1 of 3

Manual Parameter NC - Comment

bflug
Contributor
Contributor

I am using manual NC for alot of custom functions. Is there any way to access the name that I rename the operation to as a paramater so I can insert it as a comment. 

 

For a standard operation the funtion that does this is:

 

if (hasParameter("operation-comment")) {
var comment = getParameter("operation-comment");
if (comment) {
writeComment(comment);

 

I have tried variations like below but they dont seem to work:

 

if (hasParameter("parameter-comment")) {
var comment = getParameter("parameter-comment");

 

I'm hoping there is a more elegant solution that putting it in my value as a comment

 

 

618 Views
2 Replies
Replies (2)
Message 2 of 3

Laurens-3DTechDraw
Mentor
Mentor

Use the dump post processor to find out how the parameter is called for the operations name.

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
Found out the hard way is the best way to win.


0 Likes
Message 3 of 3

bflug
Contributor
Contributor

It appears the only information passed to the post is the value field and the type of parameter. If anyone stumbles upon this someday and wants a solution I would recommend something like the following 

 

EXAMPLE: manual NC subprogram call value field : BAR FEED CYCLE,OBAR PCR=1 SPOS=0.015

 

function onSubProgram (value)
{
writeln("");
onOperationNumber(); (MY CUSTOM NAT COUNTER)
commaIndex = value.indexOf(",");
var subComment = value.substring(0,commaIndex);
var call = value.substring(commaIndex + 1);
writeComment(subComment);
writeln("CALL " + String(call));
writeln("M1");
}

 will produce ----> 

NAT03 (BAR FEED CYCLE)
CALL OBAR PCR=1 SPOS=0.015
M1