Identify Post and Post and Save in post-processor

Hello everybody,

I added a script to the post processor to automatically create an xml file with the tools used in a format compatible with our CNC so when the postprocessor is run I get the NC file and the CTF (Cnc Tools File in xml format) with all the information on the tools used to import to the CNC controller.

I would like to know if there is a way in the post processor to get if the executed post step is “Post” for preview only in BobCAD-CAM “Posting” panel or “Post & Save As …” to physically create the file to the right location in the file system and avoid creating the CTF file when it is displayed only in the “Posting” view.
Mill.zip (8.1 KB)

1 Like

Hello Silverio,

I don’t believe there is a way to tell how it was executed. When the posting engine is triggered, it is just triggered.

I am not sure if there is a way using Lua Scripting though. A little known fact is that we have Lua Scripting access now in the software. Most tech staff here at BCC is not very familiar yet with Lua so it’s not something we talk about much. Our Developers did add support for it though. I will ask the Dev team about this application to see if it might work for you.

As for the XML you are generating: What controller is this for? I don’t believe you stated exactly what machine this is useful for. It does sound pretty cool :sunglasses:

Had a quick chat with Dev. There is not a direct way to know how it was executed, but they had an idea.

If you compared the NC file path to the default path that is defined in the Machine XML file then you would know if the Post Save As option was used because the path would be something different.

Here is the post variable and API used to access the file name and path.