根据图纸,构建坐标系。在测量圆孔之前,首先触测圆心点,设置圆心点Z轴坐标值为0。设置“搜索距离”为5,自动测量点取点Z实测值。
点Z向实测值与搜索距离5 做比较,如果小于5,表示圆孔未加工或加工没完成,直接跳到一个孔的判断和测量!
DMISMN/'Created by 山涧果子] on 星期日, 十月 29, 2017', 4.0
UNITS/MM, ANGDEC
WKPLAN/XYPLAN
PRCOMP/ON
TECOMP/ON
FLY/1.000
MODE/PROG, MAN
SNSET/APPRCH, 3.000
SNSET/RETRCT, 3.000
SNSET/DEPTH, 0.000
SNSET/SEARCH, 10.000
SNSET/CLRSRF, 30.000
RECALL/D(MCS)
SNSLCT/S(LENOVO)
GEOALG/CIRCLE, LSTSQR
GEOALG/ARC, LSTSQR
GEOALG/PLANE, LSTSQR
$$
$$
MODE/PROG,MAN
F(PLN1) = FEAT/PLANE,CART, 31.250, 46.788, 35.000, 0.000, 0.000, 1.000
$$ Measurement points are created through nominal points
MEAS/PLANE, F(PLN1), 4
GOTO/CART, 117.282, 60.869, 66.000
GOTO/CART, 5.922, 83.570, 66.000
PTMEAS/CART, 5.922, 83.570, 35.000, 0.000, 0.000, 1.000
PTMEAS/CART, 7.738, 20.403, 35.000, 0.000, 0.000, 1.000
PTMEAS/CART, 86.688, 17.792, 35.000, 0.000, 0.000, 1.000
PTMEAS/CART, 119.416, 59.003, 35.000, 0.000, 0.000, 1.000
ENDMES
D(CRD1) = DATSET/FA(PLN1), ZDIR
D(CRD1) = TRANS/ZORIG, FA(PLN1)
F(LN1) = FEAT/LINE,BND,CART, 13.179, 0.000, -18.130, 64.140, 0.000, -19.469,$
0.000, -1.000, 0.000
$$ Measurement points are created through actual points
MEAS/LINE, F(LN1), 2
PTMEAS/CART, 13.179, 0.000, -18.130, 0.000, -1.000, 0.000
PTMEAS/CART, 64.140, 0.000, -19.469, 0.000, -1.000, 0.000
ENDMES
F(LN2) = FEAT/LINE,BND,CART, 0.000, 19.485, -5.550, 0.000, 71.624, -8.905,$
-1.000, 0.000, 0.000
$$ Measurement points are created through actual points
MEAS/LINE, F(LN2), 2
PTMEAS/CART, 0.000, 19.485, -5.550, -1.000, 0.000, 0.000
PTMEAS/CART, 0.000, 71.624, -8.905, -1.000, 0.000, 0.000
ENDMES
F(PT_INTER1) = FEAT/POINT,CART, -0.176, 0.432, -11.063, 0.026, 0.064, 0.998
CONST/POINT, F(PT_INTER1), INTOF, FA(LN1), FA(LN2)
D(CRD2) = ROTATE/ZAXIS, FA(LN1), XDIR
D(CRD3) = TRANS/XORIG, FA(PT_INTER1), YORIG, FA(PT_INTER1), ZORIG, -35
$$ Set.CAD2PCS.CADM_1
$$ Set.CADViewCenter.CADM_1
MODE/PROG,MAN
SNSET/APPRCH, 3.0000
SNSET/RETRCT, 3.0000
SNSET/DEPTH, 0.0000
SNSET/SEARCH, 5
SNSET/CLRSRF, 30.0000
F(CIR1) = FEAT/CIRCLE,INNER,CART, 72.000, 55.000, 33.000, 0.000, 0.000,$
1.000, 10.000
F(PT1) = FEAT/POINT,CART, 72.000000,55.000000,35.000000, 0,0,1
MEAS/POINT, F(PT1), 1
PTMEAS/CART, 72.000, 55.000, 35.000, 0.000, 0.000, 1.000
ENDMES
DECL/COMMON,REAL,PT1_Z
PT1_Z = OBTAIN/FA(PT1),5
IF/(PT1_Z .LT.-5)
SNSET/APPRCH, 2
SNSET/RETRCT, 2
SNSET/DEPTH, 0.0000
SNSET/SEARCH, 10
SNSET/CLRSRF, 30.0000
$$ Measurement points are created through nominal points
MEAS/CIRCLE, F(CIR1), 4
PTMEAS/CART, 72.000, 60.000, 33.000, 0.000, -1.000, 0.000
PTMEAS/CART, 67.000, 55.000, 33.000, 1.000, 0.000, 0.000
PTMEAS/CART, 72.000, 50.000, 33.000, 0.000, 1.000, -0.000
PTMEAS/CART, 77.000, 55.000, 33.000, -1.000, 0.000, 0.000
ENDMES
ELSE
TEXT/OPER, '此孔没有加工!!'
TEXT/OUTFIL, '此孔没有加工!'
ENDIF