Showing results for 
Search instead for 
Did you mean: 

Dividing tool path in post output

Valued Contributor
Valued Contributor



Is it possible to devide the tool path (rapid, linear, circular, helix,...) to small segments on post output considering intool-outtool tolerances?

for example with the tolerance of 0.1

the output command:

G1 X0.0

G1 X1.0

turns into:

G1 X0.0

G1 X0.1

G1 X0.2

G1 X0.3


G1 X1.0


Kind regards,



Re: Dividing tool path in post output

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

This could be done, but could be "interesting" for some cases.

If you are doing surface contouring, there is a cutting parameter (in variable axis contouring it is under the "More" tab) that is "Max Step", which allows you to control the max step size ALONG the path.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled

Re: Dividing tool path in post output

Gears Phenom Gears Phenom
Gears Phenom

in conturing max step doesnt exactly affect path segmentation


I set max step to 0.1mm and tool path is one straigth line 50mm long in one piece. (fixed contour)

N30 Y12.
N31 Y70.


I would think about custom command just before linear move to divide distance (from last to current postion) by 0.1mm and call template block.


Or maybe change something in postprocessor.


But anyway Majid said tool path tolerance 0.1 and wants X0.1,X0.2  - but tool path tolerance 0.1 doesnt mean that tool path segmentation will be by 0.1mm. Tool path tolerance is not segment length.


Question also is what is this all good for?

#♫ PB, 5ax, itnc, nx, vericut ♫ #

Re: Dividing tool path in post output


For Max Step

My understanding is... this is how far NX looks ahead to calculate it's next move.

Is you have small features you may want to dial this back or you may not get fine features.

I've also seen where the path looked good in 3d verify, but it would not pass a gouge check.

Lowered this and then it passed. My go to for fine finishes is double my intol/outol or 5% of tool in general

Lowering can produce more code.

{Paul Schneider}, {CNC Programmer}, {DRT-Rochester}

Production: {NX11.0.2,MP5, NX12.0.2, MP4}

Re: Dividing tool path in post output


In this post @MRief talks about a custom command that divides linear moves.



Re: Dividing tool path in post output

Valued Contributor
Valued Contributor



Thanks a lot for the relpies. Max Step did not work for me too. And @agrivas, I encounter the following prompt when clicking on the link by MRief:

"You do not have sufficient privileges for this resource or its parent to perform this action.

Click your browser's Back button to continue."


I tried many things since yesterday but the best working option was a code I wrote last night. Here I share it in case anyone would need it in the future:


At the very beginning of the Program Start Sequence add:


global mom_kin_read_ahead_next_motion
set mom_kin_read_ahead_next_motion TRUE


And add this code anywhere you wish to devide lines: (edit MOM_do_template commands to sort out your own output)


global mom_tool_axis mom_nxt_tool_axis mom_mcs_goto mom_nxt_mcs_goto mom_inside_outside_tolerances mom_pos

global X1 Y1 Z1 X2 Y2 Z2
set X1 $mom_mcs_goto(0)
set Y1 $mom_mcs_goto(1)
set Z1 $mom_mcs_goto(2)
set X2 $mom_nxt_mcs_goto(0)
set Y2 $mom_nxt_mcs_goto(1)
set Z2 $mom_nxt_mcs_goto(2)
set dX [expr $X2 - $X1]
set dY [expr $Y2 - $Y1]
set dZ [expr $Z2 - $Z1]
set distance [expr { sqrt( $dX * $dX + $dY * $dY + $dZ * $dZ ) }]
set tolerance [expr $mom_inside_outside_tolerances(0) + $mom_inside_outside_tolerances(1)]
set divisions [expr {round([expr $distance / $tolerance])}]
if { $distance > $tolerance } {
    for { set i 1 } { $i < $divisions } { incr i } {
        set mom_pos(0) [expr $X1 + ($X2 - $X1) * $i / $divisions]
        set mom_pos(1) [expr $Y1 + ($Y2 - $Y1) * $i / $divisions]
        set mom_pos(2) [expr $Z1 + ($Z2 - $Z1) * $i / $divisions]
        MOM_do_template linear_move



It can be used also on rapid move, and I changed circular move to lines. It needs to be completed to manage G_motion properly.


Kind regards,



Re: Dividing tool path in post output


Sorry, I tagged the wrong user, it should be @MarkRief 


The link is to the old bbs archive, you need webkey to access this not just a forum logon.



Learn online

Solution Information