Run external program with post processors

Run external program with post processors

thePostmaster
Enthusiast Enthusiast
279 Views
2 Replies
Message 1 of 3

Run external program with post processors

thePostmaster
Enthusiast
Enthusiast

Greetings

 

Is it possible to write a post processor that will automatically call an external application, other than the chosen g-code editor?  I need it to run a program from command prompt in order to convert from plain text to the CNC's proprietary file format. 

 

It is for SCM, converting from .xxl to .pgm. 

 

Thanks 

0 Likes
Accepted solutions (1)
280 Views
2 Replies
Replies (2)
Message 2 of 3

boopathi.sivakumar
Autodesk
Autodesk
Accepted solution

Hi @thePostmaster 

yes it is possible to call an external application in the program.

really a bad example but showcases the ability I have a simple batch file in my desktop which renames the output file extension. so in my post processor I have created the onTerminate function where you have options to call excute function where you can pass the arguments and the application to exectue

function onTerminate() {
  var exePath = "C:\\Users\\usename\\Desktop\\changeExtension.bat";
  if (!FileSystem.isFile(exePath)) {
    error(localize("File path not found."));
    return;
  }
  var outputPath = getOutputPath();
  var args = outputPath + " " + "txt";
  execute(exePath, args, false, "");
}

here is more info 

https://cam.autodesk.com/posts/reference/classPostProcessor.html#a928dbdfdce0b18a30c7cc2e9dcc8e807

 


Boopathi Sivakumar
Senior Technology Consultant

0 Likes
Message 3 of 3

thePostmaster
Enthusiast
Enthusiast

Okay, excellent. Thanks so much for this. I will test it out. 

 

Michael

0 Likes