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

source "mom_logname"

[ Edited ]

Hello.

The cc below exists in every post processor and is executed at the start(program header.)

Is there a way to source the programmer list outside PB?

Currently as new programmers join the company, eg. Porky Pig, I need to go into each post & populate the name to the cc listed.

 

global mom_logname


if {$mom_logname == "bbunny"} {
  set my_logname "Bugs Bunny"
  }
if {$mom_logname == "dduck"} {
  set my_logname "Daffy Duck"
  }

MOM_output_literal "; PROGRAMMER:  $my_logname"

 

 

Thanks.

Kal.

NX 9.0.3.4 MP12
PB 9.0.3.2
Vericut7.3.4
3 REPLIES

Re: source "mom_logname"

[ Edited ]

hre you are nice example

 

https://community.plm.automation.siemens.com/t5/Tech-Tips-Knowledge-Base-NX-Manufacturing/Tool-Comma...

 

 

---------------------------------------------
#♫ PB, 5ax, itnc, nx, vericut ♫ #
Solution
Solution
Accepted by topic author Kal
‎05-15-2017 08:41 PM

Re: source "mom_logname"

[ Edited ]

as @Juraj says, have a look 'source' , there are many ways, but below my solution (with 'array') :

source C:/list_user.txt

list_user.txt :

array set list_user {
bbunny {Bugs Bunny}
dduck {Daffy Duck}
mmouse {Mickey Mouse}
hsimpson {Homer Simpson} }

 your_post.tcl :

global mom_logname
global list_user

if {[info exists list_user($mom_logname)]} {
MOM_output_literal "; PROGRAMMER:  $list_user($mom_logname)"
} else {
MOM_output_literal "; PROGRAMMER:  $mom_logname what are you doing here ???"
}

 

@mkn

Re: source "mom_logname"

[ Edited ]

MKN & Juraj.

Thank you both for your help. Smiley Happy

Kal.

NX 9.0.3.4 MP12
PB 9.0.3.2
Vericut7.3.4

Learn online





Solution Information