NX TCL Code that Reports the Programmer's Name by Reading the logname Variable

2020-10-05T13:21:17Z
NX for Manufacturing

Summary


Details

When posting an NC file, Post Builder has the ability to report the programmer's identity by reading the logname variable. Some logname  values may not clearly identify to the machine operator who the programmer is, though. What TCL code can be used to list the programmer's first and last name based on their logname ?

Solution

Create a Custom Command and add the TCL code found below. The logname and the first and last name for each programmer must be added after the foreach{i j k} { command.  This code could be modified to be used in a Sourced TCL file.  The \ character is used in this sample code after a line of data to show that the data is being continued on the next line.  This character is added so that the data elements can be listed in a column type format.


### Finding the programmer's name from the logname 

global mom_logname 

global mom_sys_control_in 

global mom_sys_control_out

set co $mom_sys_control_out 

set ci $mom_sys_control_in 

set localoutput "No programmer name match"

# logon first last 

foreach {i j k} { 

   bill4     Bill      Boyd\ 

   fred2     Fred      Wright\ 

   julie3    Julie     Brown\ 

   charlie   Charlie   Waters\ 

   julie4    Julie     Johns\ 

   jim3      Jim       McCay

   waser     Randy     Waser} { 

      if { $i == $mom_logname } { 

         set localoutput "$j $k" 

      } 

MOM_output_literal "$co\Programmer: $localoutput$ci"

### 

Notes

Please be aware that any code provided by NXCAM Support is intended to be used for sample purposes only. It is the user's responsibility to determine whether the code is suitable for the purpose.

KB Article ID# PL8966573

Contents

SummaryDetails

Associated Components

Manufacturing Post Builder