Showing results for 
Search instead for 
Do you mean 
Solved! Go to solution

Postprocessor with multiple file


I need help for un post postprocessor with multiple output file, it's for a Roders 5 axis 

these need of two file, a main and other how subrutine,

so the post builder may shed two file for the machine?? 

or I'll to make two post, a for main and a for subrutine??



Re: Postprocessor with multiple file

You can do it with single postprocessor. A lot of way to do it. For example, for each nx operation stop standard output, open new file with operation name.spf, and output to this file.

Re: Postprocessor with multiple file

You need not have any additional postprocessors for several files.
At any moment of postprocessing you can close the main file (the variable mom_output_file_full_name stores its name) and redirect output to another file.

global mom_output_file_full_name

MOM_close_output_file $mom_output_file_full_name
MOM_open_output_file $some_sub_filename
MOM_close_output_file $some_sub_filename
MOM_open_output_file $mom_output_file_full_name

Re: Postprocessor with multiple file

Another option is to use open and puts tcl commands (to have parallel output.) You can even (still) use block templates as shown:


puts $fh "[MOM_do_template mytemplate CREATE]"

Windows 7 Pro

Re: Postprocessor with multiple file

Can you please explain what you mean with "parallel output"?

Would it be possible to take the same "input" (source ops being posted in NX), and run multiple "output" posts? I've been asked if I could take a single source file and output a file for Fanuc, Mazak, and Heidenhain, so that job could be loaded on any 3X machine on the floor. So I'd like to "spawn" another posting process, and pass the same set of input data, and generate a separate (identical path, different syntax) NC files. I'd also like to create 3 folders (named for the output format) in the same folder as the source input NX file...
Accepted by topic author Rafael_sineat
‎10-06-2016 12:00 PM

Re: Postprocessor with multiple file

If these separate files are going to be NC codes for different controllers, I would use separate postprocessors which will be easier to maintain.
But to make it easy to use as a single postprocessor, I would use MOM_run_postprocess to automatically call another postprocessor.
So user will see only one postprocessor, but it will really be several separate postprocessors called one after another. For each, you can specify output file name and directory as you prefer.


MOM_run_postprocess <event-handler Tcl file> <definition file> <output file>current post is calling itself

Runs a separate post process from within a postprocessor on the same operations or programs that are being postprocessed. Returns 1 (true) when the process execution is successful, 2 (false) if there is an execution error, -1 if the post is calling itself. You can call the same post that is executing, but typically you would use a separate post, such as a turbo post.


Marek Pawlus, NCmatic

Production: NX 11.0.1
Development: C#, Tcl/Tk, CSE

Re: Postprocessor with multiple file

The other option is to use a journal or API program to post.

You could display a dialog of all posts, and let the user select which machine(s) to post for.

Then the posts don't have to know anything about each other.


If you are going to use the MOM_run_postprocess, I would suggest following architecture:

1) each post only posts for its machine

2) you create a "multi-post" that uses MOM_run_postprocess to post the individual machine posts

(i.e. this post is called "Post_Machines_A-B-C" and uses MOM_run_postprocess to post "A" , "B:, and "C")

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled

Re: Postprocessor with multiple file

very thanks 

I use MOM_post_oper_path with your syntaxis for  call another postprocessor, where have the strcuture for each operation because I need file for each one, as they are subrutines of post processor manin



Re: Postprocessor with multiple file

Thank you Merek!


Which parameter in that function call passes the "input" data (data from operations)? That is the only part I'm not understanding.


Is there a variable that holds the "input" or "source" operation data structures? Is that the <definition file> shown in your example?

Re: Postprocessor with multiple file

I'm not sure what you are asking for

With MOM_run_postprocess, you call another postprocessor, which will postprocess all the same operations as your current postprocessor. As parameters you should specify: tcl and def file of another postprocessor and output NC file directory and name.

Marek Pawlus, NCmatic

Production: NX 11.0.1
Development: C#, Tcl/Tk, CSE

Learn online

Solution Information