UG后处理tcl语言编写技巧就上UG网,下面一段语言R输出是有问题的,我想要的输出结果是R=tr 或 R=tr1,当一个不能输出时就选择另一个输出。
- set outputthd 1
- global toollist
- mom_tool_type mom_tool_cutcom_register mom_cutcom_adjust_register
- mom_tool_name mom_tool_diameter mom_tool_corner1_radius
- mom_tool_lower_corner_radius mom_tool_adjust_register
- mom_tool_adj_reg_defined mom_tool_number
- set tdi [ format "%.2f" $mom_tool_diameter]
- if {$mom_tool_type == "Milling Tool-T Cutter"} {
- set tr1 [ format "%.2f" $mom_tool_lower_corner_radius]
- } else {
- set tr [ format "%.2f" $mom_tool_corner1_radius]
- }
- if [info exists mom_tool_number] {
- set tt $mom_tool_number
- } else {
- set tt 0
- }
- if [info exists mom_tool_adj_reg_defined] {
- set th $mom_tool_adjust_register
- } else {
- set th 0
- }
- if [info exists mom_tool_adj_reg_defined] {
- set td $mom_tool_cutcom_register
- } else {
- set td 0
- }
- set tt [format "%02.0f" $tt]
- set th [format "%02.0f" $th]
- set td [format "%02.0f" $td]
- set tt [format "%02.0f" $tt]
- set th [format "%02.0f" $th]
- set td [format "%02.0f" $td]
- if {$outputthd == 1 } {
- MOM_output_literal "(T$tt:$mom_tool_name D=$tdi R=$tr H$th D$td)"
- } else {
- MOM_output_literal "(T00:$mom_tool_name D=$tdi R=$tr H00 D$td)"
- }
复制代码
|