What you need to do here is load the programs that cut your parts into
(MM) macro memory.
In your main program memory (PM) you have a program that makes the pallet change and then calls the macro program to be executed. The macro call is done with a G22. Your programs in macro memory need to have the M30
as the last line. When the M30 is read the program control will then return to the main program. In the main program, make the pallet change to the second part and make a macro call G22 for the second part. You can loop the main program as many times as you like with a G14 N1=xxx N2=xxx J= xxx.