NX Command to Extract the Program Number and Name from the Program Group in Post Builder

2021-10-06T23:27:15Z
NX for Manufacturing

Summary


Details

The Program Group name in an NX CAM program is entered as the four digit program number followed by the program name. How can this number and name be extracted when generating output in a Post Builder post?



Solution

The string range command is used to grab the specified digits of the variable. The first four digits are read starting at digit 0 and ending at digit 3. A spacer character is added to separate the two and is ignored. Digit 5 through the last digit is read. The end word is used to indicate the last digit.

The NC output will look something like the following when complete. Notice that an O is output before the program number and the program name is enclosed in control characters.

%
O1234(ROUGHING_PROGRAM)
N0010 G40 G17 G90 G71
N0020 G91 G28 Z0.0


Below is the TCL code used to generate the output. A Custom Command with this code is placed in the Start of Program proceedure.



global mom_parent_group_name
global mom_sys_control_in
global mom_sys_control_out

set co "$mom_sys_control_out"
set ci "$mom_sys_control_in"

#DIGIT 1 TO 4
set out1 "O[string range $mom_parent_group_name 0 3]"
#DIGIT 6 TO END
set out2 "$co[string range $mom_parent_group_name 5 end]$ci"

MOM_output_text "$out1$out2"




Notes and References


Hardware/Software Configuration

Platform: all
OS: n/a
OS Version: n/a
Product: NX
Application: CAM
Version: V1859
Function: POSTBUILDER

Ref: 002-7007512

KB Article ID# PL7007512

Contents

SummaryDetails

Associated Components

Manufacturing Post Builder