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

how do you change a proc in the post tcl file

I am trying to change  MOM_start_of_group because I really don't like how it functions. I changed the tcl file directly to get it to do what I want it to do, but whenever I change the post in post builder MOM_start_of_group is set back to what it orginally was. Is there anyway I can change MOM_start_of_group in the tcl file permanitly   


Using NX

Re: how do you change a proc in the post tcl file

Can't remember the syntax off the top of my head but rename proc is what you use to rename the original and the create your own proc based on the original and call that when the original is called. Look it up in a tcl book.
Shags72 Mfg. Eng.
Windows 7 Pro 64bit
NX MP3 Teamcenter 8
Dell M6700 i7-3740QM 8GB RAM,
NVIDIA Quadro k3000M

Re: how do you change a proc in the post tcl file

There's a couple methods

1) "Source" in your own tcl file and define it there (output settings -> Other options)

2) create a custom command and "uplevel 0" your own definition in there.  Add this to the "start of program" event in PB.


As long as you don't need the original, I don't think either method needs the rename, but I might be wrong.

If it doesn't use yours, look to see if the original definition is in an "uplevel" of its own - you might ned to dd your custom command to "start of path" event

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: how do you change a proc in the post tcl file

Like has been mentioned - probably don't need a rename in this case. The problem with renames is you end up getting rid of the original unless you check to see if you already renamed. There are a couple passes through the outside code in the open in the tcl (outside of procs.) The need for rename would be when you want to use the original and add some additional feature. I would suggest something like this code:


if {![string length [info procs MOM_UGS_start_of_path]]} {rename MOM_start_of_path MOM_UGS_start_of_path}

Windows 7 Pro
Accepted by MarkRief (VIP)
‎08-26-2015 04:32 AM

Re: how do you change a proc in the post tcl file

Thanks, I changed the referenced TCL file and it works. I never knew about the uplevel and rename proc fuctions but I am sure they will come in handy another time.

Using NX

Re: how do you change a proc in the post tcl file

Just one additional comment here...


You are not really changing the actual OOTB proc from Postbuilder. You are replacing it with your own, presumably a modified version of the OOTB. This is a good practice, as it keeps your modifications separate from the OOTB.


But please remember that in a future release, the OOTB proc may change, so if something breaks later on, be sure to compare your proc to ours - you may need to update your version. 

Mark Rief
Retired Siemens

Learn online

Solution Information