Fusion Manufacture
Talk shop with the Fusion (formerly Fusion 360) Manufacture Community. Share tool strategies, tips, get advice and solve problems together with the best minds in the industry.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

add a pass trough at the beginning of the code not the end

Message 1 of 2
106 Views, 1 Reply

add a pass trough at the beginning of the code not the end



Is it possible to add a pass through add the beginning of a cycle instead of the end?

I need to terminate G199 with a G198 but at the end of the cycle or my subspindle will keep turning.


please ignore the M145 in the code this was also a Pass through that did not work, it stops the subspindle on spot and the main spindle is slowly slowing down.

Message 2 of 2

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) {


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) {
    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.




If my post answers your question, please click the "Accept Solution" button. This helps everyone find answers more quickly!



Technical Consultant

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report