( fixture offset g59p7 = part 1 , g59p8 = part 2 , g59p9 = part 3 ............. g59p253 = part 247 ) #1=4 ( number of parts to be machined e.g. #1=1 will machine 1 part #1=247 will machine 247 parts ----- max 247 parts ---- ) #2=7 (set parameter #2 to a value of 7 // the first fixture offset g59p7 for the first tool ) t1m6 (toolchange first tool) m98p1l#1 ( call subprogram o1 and repeat it as many times as the value in #1) #2=7 (set parameter #2 to a value of 7 // the first fixture offset g59p7 for the second tool ) t2m6 (toolchange second tool) m98p2l#1 ( call subprogram o2 and repeat it as many times as the value in #1) #2=7 (set parameter #2 to a value of 7 // the first fixture offset g59p7 for the third tool ) t3m6 (toolchange third tool) m98p3l#1 ( call subprogram o3 and repeat it as many times as the value in #1) #2=7 (set parameter #2 to a value of 7 // the first fixture offset g59p7 for the fourth tool ) t4m6 (toolchange fourth tool) m98p4l#1 ( call subprogram o4 and repeat it as many times as the value in #1) m30 ( main program end) % o1 (sub with toolpath first tool) g59p#2 (call the fixture offset g59p and the value of #2) g90g0x0y0z10 (your toolpath here first line) g1x10F333 (your toolpath here) y10 (your toolpath here) x0 (your toolpath here) y0 (your toolpath here last line) #2=[#2+1] ( count up #2 by a value of 1 for the next part ) m99 ( sub end and back to main program) % o2 (sub with toolpath second tool) g59p#2 g90g0x0y0z10 g1x8 y8 x0 y0 #2=[#2+1] m99 % o3 (sub with toolpath third tool) g59p#2 g90g0x0y0z10 g1x6 y6 x0 y0 #2=[#2+1] m99 % o4 (sub with toolpath fourth tool) g59p#2 g90g0x0y0z10 g1x4 y4 x0 y0 #2=[#2+1] m99 %