This routine will sample 4 points around the manual touch and calculate the actual hit based on a sampled planeDMISMN/'Created by [山涧果子] on 星期四, 一月 25, 2018', 4.0UNITS/MM, ANGDECWKPLAN/XYPLANPRCOMP/ONTECOMP/ONFLY/1.000000MODE/MANSNSET/APPRCH, 3SNSET/RETRCT, 3SNSET/DEPTH, 0SNSET/SEARCH, 10SNSET/CLRSRF, 30RECALL/D(MCS)SNSLCT/S(ROOTSN1)GEOALG/CIRCLE, LSTSQRGEOALG/ARC, LSTSQRGEOALG/PLANE, LSTSQR$$$$ 这个程序的目的,手动随机取一点,根据取样距离,实际触测四点,测量平面!MODE/MANDECL/COMMON, INTGR, KNPTN1KNPTN1 = PROMPT/TEXT, '请手动在工件上表面测量一点!'F(PT1) = FEAT/POINT,CART, 0, 0, 0, 0.000000,$ 0.000000, 1.000000$$ Empty Meas BlockMEAS/POINT, F(PT1), 1ENDMESD(CRD1) = TRANS/XORIG, FA(PT1), YORIG, FA(PT1), ZORIG, FA(PT1)MODE/PROG,MANDECL/COMMON,DOUBLE,X1,Y1,Z1,I1,J1,K1DECL/COMMON,DOUBLE,JuliJuli = PROMPT/'请输入用于取样的距离!!'X1 = OBTAIN/FA(PT1),3Y1 = OBTAIN/FA(PT1),4Z1 = OBTAIN/FA(PT1),5I1 = OBTAIN/FA(PT1),6J1 = OBTAIN/FA(PT1),7K1 = OBTAIN/FA(PT1),8DECL/COMMON,DOUBLE,Xmes1,Ymes1,Zmes1DECL/COMMON,DOUBLE,Xmes2,Ymes2,Zmes2DECL/COMMON,DOUBLE,Xmes3,Ymes3,Zmes3DECL/COMMON,DOUBLE,Xmes4,Ymes4,Zmes4Xmes1 = ASSIGN/X1+(1-I1)*JuliYmes1 = ASSIGN/Y1+(1-J1)*JuliZmes1 = ASSIGN/Z1+(1-K1)*JuliXmes2 = ASSIGN/X1+(1-I1)*JuliYmes2 = ASSIGN/Y1-(1-J1)*JuliZmes2 = ASSIGN/Z1-(1-K1)*JuliXmes3 = ASSIGN/X1-(1-I1)*JuliYmes3 = ASSIGN/Y1-(1-J1)*JuliZmes3 = ASSIGN/Z1+(1-K1)*JuliXmes4 = ASSIGN/X1-(1-I1)*JuliYmes4 = ASSIGN/Y1+(1-J1)*JuliZmes4 = ASSIGN/Z1-(1-K1)*JuliF(PLN1) = FEAT/PLANE,CART, X1, Y1, Z1, I1,J1, K1$$ Measurement points are created through nominal pointsMEAS/PLANE, F(PLN1), 4 PTMEAS/CART, Xmes1,Ymes1,Zmes1, I1,J1, K1 PTMEAS/CART, Xmes2,Ymes2,Zmes2, I1,J1, K1 PTMEAS/CART, Xmes3,Ymes3,Zmes3, I1,J1, K1 PTMEAS/CART, Xmes4,Ymes4,Zmes4, I1,J1, K1 ENDMES来源:山涧果子