|
发表于 2024-8-31 09:25:51
|
显示全部楼层
其实你应该这样发代码就不会乱了。
- global mom_stock_floor mom_stock_part mom_wall_stock mom_stock_part_use
- global sidestock floorstock mom_operation_type
- if {[info exists mom_stock_part]} {
- set sidestock $mom_stock_part
- if {[info exists mom_wall_stock] && $mom_wall_stock != 0} {
- set sidestock $mom_wall_stock
- }
- } else {
- set sidestock 0
- }
- if {[info exists mom_stock_floor]} {
- if {[info exists mom_stock_part_use] && $mom_stock_part_use == 0 && [info exists mom_stock_part]} {
- set floorstock $mom_stock_part
- } else {
- set floorstock $mom_stock_floor
- }
- } else {
- set floorstock 0
- }
- if {([info exists sidestock] && $sidestock != 0) || ([info exists floorstock] && $floorstock != 0)} {
- if {$mom_operation_type != "Point to Point" && $mom_operation_type != "Drilling"} {
- MOM_output_literal "(XY=[string trimright [format "%.2f" $sidestock] "0"]mm Z=[string trimright [format "%.2f" $floorstock] "0"]mm)"
- }
- }
复制代码 |
|