global mom_msys_origin mom_msys_matrix
global clm mom_clearance_plane_status mom_clearance_plane_point
global UD_clearance_plane #1 true 0 No Set -1 False
global UD_clearance_value
set UD_clearance_check 1
程序:
# clearance plane check
if { $mom_clearance_plane_status == 1} {
if {[info exists mom_clearance_plane_point]} {
set UD_clearance_check 1
if { $mom_msys_matrix(8) == 1 } {
set UD_clearance_value [expr $mom_clearance_plane_point(2)-$mom_msys_origin(2)] }
if { $mom_msys_matrix(8) == -1 } {
set UD_clearance_value [expr $mom_msys_origin(2) - $mom_clearance_plane_point(2)] }
if { $mom_msys_matrix(7) == 1 } {
set UD_clearance_value [expr $mom_clearance_plane_point(1)-$mom_msys_origin(1)] }
if { $mom_msys_matrix(7) == -1 } {
set UD_clearance_value [expr $mom_msys_origin(1) - $mom_clearance_plane_point(1)] }
if { $mom_msys_matrix(6) == 1 } {
set UD_clearance_value [expr $mom_clearance_plane_point(0)-$mom_msys_origin(0)] }
if { $mom_msys_matrix(6) == -1 } {
set UD_clearance_value [expr $mom_msys_origin(0) - $mom_clearance_plane_point(0)] }
if { $UD_clearance_value<10 || $UD_clearance_value></a>100 } { set UD_clearance_plane -1 }
} else {
set UD_clearance_plane 0
set UD_clearance_check 0
}
} else {
set UD_clearance_plane 0
set UD_clearance_check 0
}
输出:
if { $UD_clearance_check==1 } {
MOM_output_text ";N00 ( Clearance Plane: [format "%5.2f" $UD_clearance_value ] )"
} {
MOM_output_text ";N00 ( Clearance Plane: No Set ) "
}