if {[file exists $tmp_file_name]} {
MOM_remove_file $tmp_file_name
}
MOM_close_output_file $ptp_file_name
file rename $ptp_file_name $tmp_file_name
set ifile [open $tmp_file_name r]
set ofile [open $ptp_file_name w]
#############################################
global mom_output_file_basename
global mom_part_name
puts $ofile "%"
set a [clock format [clock seconds] -format "%Y-%m-%d"]
puts $ofile "( $a )"
puts $ofile "( Max Z = [format %.3f $mom_sys_max_travel(2)] MIN Z = [format %.3f $mom_sys_min_travel(2)] )"
global tooli numbers toolnumbers sametoolZmin
global toollistend ii iii Step numbers
for { set ii 0 } { $ii < $numbers } { incr ii } {
set iii [expr $ii+1 ]
puts $ofile "( $toollistend($ii) ZMIN=[format "%.3f" $sametoolZmin($toolnumbers($iii))] )"
}
set buf ""
while { [gets $ifile buf] > 0 } {
puts $ofile $buf
}
close $ifile
close $ofile
MOM_remove_file $tmp_file_name
MOM_open_output_file $ptp_file_name