get cut direction of toolpath macro

get cut direction of toolpath macro

bfaberBB7MX
Contributor Contributor
657 Views
6 Replies
Message 1 of 7

get cut direction of toolpath macro

bfaberBB7MX
Contributor
Contributor

Im having some issues with a macro to determine if a tool path is set to climb or conventional. It seems like regardless of what I select in the toolpath setting window running print $toolpath.cutdirection always returns climb. Is there another way to get the direction of cut for a toolpath?

0 Likes
Accepted solutions (1)
658 Views
6 Replies
Replies (6)
Message 2 of 7

Sean571
Advocate
Advocate

Sean571_0-1691763201373.png


It worked for me. Maybe you are trying with an Area Clearance toolpath? Or you haven't hit Okay or calculated the toolpath. If you just change the cut direction but don't hit okay on the toolpath then it won't update.


If it is an Area Clearance Toolpaths you have two different types of cut direction, "profile" and "area" and "area" uses the $toolpath.cutdirection parameter, but "profile" uses the $toolpath.AreaClearance.Profile.CutDirection parameter

 

Sean Wroblewski
Applications Engineer

Message 3 of 7

bfaberBB7MX
Contributor
Contributor

I should have probably narrowed it down a bit, in a curve profile path it will read climb regardless of the tool path setting. It does read correctly for a constant z path.

bfaberBB7MX_0-1691763904803.png

 

I guess thinking about it more if the toolpath is reversed after calculation, I wouldn't get the correct result anyways...

0 Likes
Message 4 of 7

Sean571
Advocate
Advocate
Accepted solution

That's because the Curve profile toolpath is actually considered an Area Clearance toolpath. Just by having echo commands on and the command window open you can see that when you change the cut direction. So you are using the wrong parameter.

Sean571_0-1691770743386.png

 

Sean Wroblewski
Applications Engineer

Message 5 of 7

bfaberBB7MX
Contributor
Contributor

ahh I see. would have never guessed that. Im assuming there is no way to get the cut direction if it was reversed after calculation?

0 Likes
Message 6 of 7

bfaberBB7MX
Contributor
Contributor

Another question for you. Is there a more elegant way to figure out if a toolpath uses .cutdirection vs .areaclear.profile.cutdirection in the macro? I guess the sledge hammer approach is to just do a bunch of 'or' statements with all of the different types of toolpaths that use each, but there has to be a better way.

0 Likes
Message 7 of 7

bfaberBB7MX
Contributor
Contributor
Disregard that last reply, I found that the active() function solves my issue.
0 Likes