Customize code

Customize code

sevenfive85
Advocate Advocate
967 Views
4 Replies
Message 1 of 5

Customize code

sevenfive85
Advocate
Advocate

hello all,

I am customizing my lathe post using a generic fanuc. So far I am having trouble outputting this line. I would like for it to output T-1 when i check the machine inside box and T1 if it is not check.

please help thank you.

 

 

 

I think the code should look something like this? not too sure tho.

 

 

 

if (tool.machineInside) {                          ***THIS LINE IS PROBABLY NOT CORRECT***
writeBlock("T-1");
} else {
writeBlock("T1");
}

0 Likes
Accepted solutions (1)
968 Views
4 Replies
Replies (4)
Message 2 of 5

Laurens-3DTechDraw
Mentor
Mentor

@mapsymap wrote:

hello all,

I am customizing my lathe post using a generic fanuc. So far I am having trouble outputting this line. I would like for it to output T-1 when i check the machine inside box and T1 if it is not check.

please help thank you.

 

 

 

I think the code should look something like this? not too sure tho.

 

 

 

if (tool.machineInside) {                          ***THIS LINE IS PROBABLY NOT CORRECT***
writeBlock("T-1");
} else {
writeBlock("T1");
}


Are you looking to give the toolnumber a - when doing inside?

Or are you just looking to output T1 and T-1?

Laurens Wijnschenk
3DTechDraw

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


0 Likes
Message 3 of 5

sevenfive85
Advocate
Advocate

yes I am just looking for it to output the T1 or T-1 when box is check or uncheck. This value has nothing to do with the tool number. thank u

0 Likes
Message 4 of 5

Laurens-3DTechDraw
Mentor
Mentor
Accepted solution
if (hasParameter("operation:machineInside")) {
            if (getParameter("operation:machineInside") == 1) {
            writeBlock("T-1"); 
            } else {
            writeBlock("T1");
            }
}

That is the code that should work.

Now only keep in mind that for milling and drilling operations it won't do anything.

So you could make another else at the end to force T1 if the operation doesn't have the the Parameter machineInside.

Also keep in mind that a different solution might be needed for Inventor HSM & Fusion due to the turning operations being set up differently.

Laurens Wijnschenk
3DTechDraw

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


0 Likes
Message 5 of 5

sevenfive85
Advocate
Advocate

THANK U Lauren

0 Likes