Cancel
Showing results for 
Search instead for 
Did you mean: 

[Post Builder] Sub Program

Solution Partner Innovator Solution Partner Innovator
Solution Partner Innovator

Hi

 

I want to output it as a subprogram.

 

## Information

1. Version : NX11.0.2

2. Type : hor -5axis table-table BC TYPE

3.ex)

 

sample11.jpg

 

I want to output the subprogram code path at the end of the program in the same file.

thank you for you support.

6 REPLIES

Re: [Post Builder] Sub Program

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

What I'd try

1) In post builder, try turning on "Output settings" -> "Other options" -> "Generate Group Output".  Split your operations up into groups as needed.
I don't know, but that may get you close...

 

2) Write code that closes the "main" output file at the appropriate point, then opens a 2nd file, outputs to the 2nd file for the "subroutine", then closes it and re-opens the main when it should be done.  In "End of program" glom the subroutine file(s) back into the main using "regular" tcl code.  (you could try saving the output in a tcl variable instead of writing to a 2nd file, but if your program is huge, I don't know the memory/performance implications of doing that.  But the variable would be easier to "write" back to the main file)

 

3) You could have a post run a 2nd post (which would create the "main" part of the program)  Then the first post would open that same file & output all the subroutines.

 

All in all, (unless (1) works) you are in for a lot of work, which raises the question "why do you want to do this?"

 

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


Re: [Post Builder] Sub Program

Solution Partner Innovator Solution Partner Innovator
Solution Partner Innovator

Hi ken

Thank you for your advice.

 

How to set the codes in the sub program file to the main program at the end of program?

Re: [Post Builder] Sub Program

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

So basically, after everything has been posted, you have 2 or more files.

To glom them together, you need to

1) Make sure NX has all the output files closed (use MOM_close_output_file as appropriate)

2) Use standard tcl commands to open/read/write from other files to end of main file (file / open / close / gets / puts / etc.) - see here for docs: http://tmml.sourceforge.net/doc/tcl/

 

You can always Google to find more tcl examples of opening /reading/writing/closing files.

 

Ken

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


Re: [Post Builder] Sub Program

Gears Phenom Gears Phenom
Gears Phenom

Yesterday I gave a presentation at the North East Regional User Group meeting on NC Sub programs using Post Builder

The presentation and example files are available on the PLM World website. http://www.plmworld.org/

 

You need a login, which is free, and you can select File Libraries  and the list of RUG's are available.  Use at your own risk

 

Edited to fix typo

John Joyce, Manufacturing Engineer,
Senior Aerospace
Statements and opinions are mine alone and do not reflect
the opinion of my employer or any other member of the human race

Re: [Post Builder] Sub Program

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

There is a typo in John's post.

PLMworld web site is

http://www.plmworld.org/

 

(no "a")

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


Re: [Post Builder] Sub Program

Gears Phenom Gears Phenom
Gears Phenom

Thanks Ken!!

John Joyce, Manufacturing Engineer,
Senior Aerospace
Statements and opinions are mine alone and do not reflect
the opinion of my employer or any other member of the human race

Learn online





Solution Information