The "extension" variable was not defined with an "mom" in front of it, and yet when I called it out, I put one in front because I was following the format of what I saw in the above lines. It's the kind of mistake you make when you really don't know what the hell you're doing.
Anyway, I'll paste below what worked for me. I'm kind of surprised the shop docs don't have this info OTB. I don't know how set up guys can chuck up tools without it.
global mom_tool_length
global mom_tool_holder_offset
global extension
set extension [expr $mom_tool_length - $mom_tool_holder_offset]
MapToolType tool_type
if {$setup_header > 1} \
{
if { [string compare $tool_head $tool_type] } { return }
if { $mom_template_subtype == "" } { set mom_template_subtype $mom_tool_type }
switch $tool_head \
{
"DRILL" {
set pi [expr 2 * asin(1.0)]
set mom_tool_point_angle [expr [expr 180 / $pi] * \
$mom_tool_point_angle]
MOM_output_literal "<tr>"
MOM_output_literal "<td ALIGN=CENTER>$mom_tool_name</td>"
MOM_output_literal "<td ALIGN=CENTER>$mom_tool_description</td>"
MOM_output_literal "<td ALIGN=CENTER>[format "%10.4f" \
$mom_tool_diameter]</td>"
MOM_output_literal "<td ALIGN=CENTER>[format "%10.4f" \
$mom_tool_point_angle]</td>"
MOM_output_literal "<td ALIGN=CENTER>[format "%10.4f" \
$mom_tool_flute_length]</td>"
MOM_output_literal "<td ALIGN=CENTER>$mom_holder_description</td>"
MOM_output_literal "<td ALIGN=CENTER>[format "%10.3f" \
$extension]</td>"
MOM_output_literal "<td ALIGN=CENTER>[format "%10d" \
$mom_tool_length_adjust_register]</td>"
MOM_output_literal "</tr>"
Ray S
NX 7.0.1.7