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.
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.
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]"
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.
Development: C#, Tcl/Tk, CSE
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")
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled
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
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?
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.
Development: C#, Tcl/Tk, CSE