Hello @thierry924K4
you can 't change the pass-through location in the intermediate code.
But you can change when you want to output it.
Pass-through will be send between sections.

In the example above, the pass-through command occurs between the onSectionEnd call for the Parallel1 operation.
Then we will be interpreting onSection call for the operation Swarf1 (2).
It means that the retract, coolant off. from the previous operation is outputted at the beginning of the next operation section.
If you want to output the pass-through command somewhere else, you can modify the function, for storing the elements.
Initial code :
function onPassThrough(text) {
var commands = String(text).split(",");
for (text in commands) {
writeBlock(commands[text]);
}
}
Modified code:
var storedPassThrough = "";
function onPassThrough(text) {
storedPassThrough = text;
}
Then in the appropriate location in the onSection function, where you want to output the commands, you can add this code.
if (storedPassThrough != "") {
var commands = String(storedPassThrough).split(",");
for (text in commands) {
writeBlock(commands[text]);
}
storedPassThrough = "";
}
Known caveat, all the pass through commands will be outputted in that new location.
If it does not suit you, then add some logic in the onPassThrough function, seaching for substring, for example.
And reacting differently if it's that command or not.
Regards.
______________________________________________________________
If my post answers your question, please click the "Accept Solution" button. This helps everyone find answers more quickly!