NX Output the Sequence N Number at every Operation with Format N<index>< tool number>

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

Summary


Details

A sequence N number needs to be added to the G-code output of a Post Builder post. This N number would have a total of four characters and would be output at the beginning of every operation. The first two digits of the output would be an index number telling how many operations have previously used this tool. The last two digits would indicate the tool number. The picture below shows the desired output. What TCL code can be used for this?



Solution

Add the following Custom Command to the Start of Path proc. Be careful that the code looks like the picture below and that no line wraps to the next line.



###
global mom_tool_number
global mom_tool_index
 
if { ![info exists mom_tool_index($mom_tool_number)] } {
      set mom_tool_index($mom_tool_number) 1
   } else {
      set mom_tool_index($mom_tool_number) [expr $mom_tool_index($mom_tool_number) + 1]
   }
 
 MOM_output_text "N[format "%-4.4d" [expr $mom_tool_index($mom_tool_number)*100+$mom_tool_number]]"
###

Notes and References

Please be aware that any code provided by GTAC 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.

Hardware/Software Configuration

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

Ref: 002-8015605

KB Article ID# PL8015605

Contents

SummaryDetails

Associated Components

Manufacturing Post Builder