Is it possible to add a popup dialog function to the post so it will display the tool being used as an extra verification when post processing?
Solution
NX comes with a predefined 'pause' function to handle simple cases like this. The file
\MACH\auxiliary\mom_pause_win64.tcl
is a standard tk file type extension for the tcl used in the post processor. The post can call this file just as it stands with a minimum of extra work. It is fully expandable and customizable, if tcl/tk programming knowledge is available. Please reference the comments in the header of the mom_pause_win64.tcl file for usage options and command format.
As an example, a custom command like the following can be added to the tool change event in the post:
#=============================================================
proc PB_CMD_pause_for_tool_check { } {
#=============================================================
global mom_tool_name
global pause_file_name
set pause_file_name "pausefile.txt"
set cam_aux_dir [MOM_ask_env_var UGII_CAM_AUXILIARY_DIR]
regsub -all {\\} $cam_aux_dir {/} cam_aux_dir
regsub -all { } $cam_aux_dir {\ } cam_aux_dir
open "|${cam_aux_dir}ugwish ${cam_aux_dir}mom_pause_win64.tcl
$pause_file_name $mom_tool_name"
file delete $pause_file_name
}
The command can support up to three arguments by default, so it is possible to rearrange the output and get the tool name as the title bar in the popup dialog, and then the tool description as the text inside the dialog itself. There is a small adjustment in the syntax to use both tool parameters and make the description string output correctly:
#=============================================================
proc PB_CMD_pause_for_tool_check { } {
#=============================================================
global mom_tool_name
global mom_tool_description
global pause_file_name
set pause_file_name "pausefile.txt"
set cam_aux_dir [MOM_ask_env_var UGII_CAM_AUXILIARY_DIR]
regsub -all {\\} $cam_aux_dir {/} cam_aux_dir
regsub -all { } $cam_aux_dir {\ } cam_aux_dir
open "|${cam_aux_dir}ugwish ${cam_aux_dir}mom_pause_win64.tcl
$pause_file_name $mom_tool_name {$mom_tool_description}"
file delete $pause_file_name
}
Please note that these examples are very basic implementations of the command. This is an undocumented function that is primarily added to the software as a debugging tool (reference FAQ 001-5021444). The custom commands above have no error checking or intelligence added. This is all standard tcl/tk programming once the post makes that call to create the dialog, and knowledge of that language will be required to develop robust code for the specific requirements of the intended post.
Notes