cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

how do you change a proc in the post tcl file

Valued Contributor
Valued Contributor

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 8.0.3.4
5 REPLIES

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

Master
Master
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 8.5.2.3 MP3 Teamcenter 8
Dell M6700 i7-3740QM 8GB RAM,
NVIDIA Quadro k3000M

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

Esteemed Contributor
Esteemed Contributor

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

Phenom
Phenom

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}

NX10.03
Windows 7 Pro

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

Valued Contributor
Valued Contributor

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 8.0.3.4

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