Ug后处理这个tcl语言该如何写 10
setoutputthd1globaltoollistmom_tool_typemom_tool_cutcom_registermom_cutcom_adjust_reg...
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)"
}
上面一段语言R输出是有问题的,我想要的输出结果是R=tr 或 R=tr1,当一个不能输出时就选择另一个输出。
希望哪位大神指点一下, 展开
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)"
}
上面一段语言R输出是有问题的,我想要的输出结果是R=tr 或 R=tr1,当一个不能输出时就选择另一个输出。
希望哪位大神指点一下, 展开
1个回答
展开全部
if {$mom_tool_type == "Milling Tool-T Cutter"} {
set tr1 [ format "%.2f" $mom_tool_lower_corner_radius]
1. 添加 set outputthd 0
}
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)"
2.tr改成tr1 MOM_output_literal "(T00:$mom_tool_name D=$tdi R=$tr1 H00 D$td)"
希望对你有帮助!
set tr1 [ format "%.2f" $mom_tool_lower_corner_radius]
1. 添加 set outputthd 0
}
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)"
2.tr改成tr1 MOM_output_literal "(T00:$mom_tool_name D=$tdi R=$tr1 H00 D$td)"
希望对你有帮助!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询