RationalDMIS 7.1 高级编程2020

Posted 山涧果子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RationalDMIS 7.1 高级编程2020相关的知识,希望对你有一定的参考价值。

$$/*  Header
DMISMN/Created by [爱科腾瑞科技(北京)有限公司-101520-DEMO-10546A(深圳力合)] on Tuesday, June 30, 2020, 4.0
UNITS/MM, ANGDEC, MMPS
WKPLAN/XYPLAN
PRCOMP/ON
TECOMP/ON
FLY/1.0000
MODE/PROG, MAN
SNSET/APPRCH, 2.0000
SNSET/RETRCT, 2.0000
SNSET/DEPTH, 0.0000
SNSET/SEARCH, 10.0000
SNSET/CLRSRF, 20.0000
RECALL/D(MCS)
SNSLCT/S(30-1_0_1_21_1)
GEOALG/BF, LSTSQR
GEOALG/ANGLB, DEFALT
GEOALG/CIRCLE, LSTSQR
GEOALG/ARC, LSTSQR
GEOALG/PLANE, LSTSQR
$$
$$
$$*/
MODE/MAN
F(PT1)=FEAT/POINT,CART,8.7030,216.2569,0.0000,0.0000,0.0000,1.0000
MEAS/POINT, F(PT1), 1
PTMEAS/CART, 8.7030,216.2569,0.0000,0.0000,0.0000,1.0000
ENDMES
F(PT2)=FEAT/POINT,CART,35.9375,7.8872,0.0000,0.0000,0.0000,1.0000
MEAS/POINT, F(PT2), 1
PTMEAS/CART, 35.9375,7.8872,0.0000,0.0000,0.0000,1.0000
ENDMES
F(PT3)=FEAT/POINT,CART,147.2169,33.5469,0.0000,0.0000,0.0000,1.0000
MEAS/POINT, F(PT3), 1
PTMEAS/CART, 147.2169,33.5469,0.0000,0.0000,0.0000,1.0000
ENDMES
F(PT4)=FEAT/POINT,CART,38.3759,0.0000,-5.4193,0.0000,-1.0000,0.0000
MEAS/POINT, F(PT4), 1
PTMEAS/CART, 38.3759,0.0000,-5.4193,0.0000,-1.0000,0.0000
ENDMES
F(PT5)=FEAT/POINT,CART,147.6559,0.0000,-4.7724,0.0000,-1.0000,0.0000
MEAS/POINT, F(PT5), 1
PTMEAS/CART, 147.6559,0.0000,-4.7724,0.0000,-1.0000,0.0000
ENDMES
F(PT6)=FEAT/POINT,CART,0.0000,21.6790,-6.6007,-1.0000,0.0000,0.0000
MEAS/POINT, F(PT6), 1
PTMEAS/CART, 0.0000,21.6790,-6.6007,-1.0000,0.0000,0.0000
ENDMES

$$ CREATED BY : External-Array Software, Inc
$$ DATE : April 22, 2007
$$ DISLAIMER:
$$ This Macro has been tested internally but not been tested with
$$ other DMIS compatible software. This Macro is provided as sample
$$ and can be modifed for your own use. External-Array doesnt not
$$ guarantee the quality of this Macro.

$$ FUNCION: Set up a new coordinate system with 6 input points
$$ such that the first 3 points controls the Z direction
$$ and origin. Point 4 and 5 controls X direction and
$$ and Y origin. The positive X is from 4 to 5
$$ Point 6 control the X origin
$$ CRDLABEL is the final coordinate system LABEL.

M(EASI_6PT_TO_CRD) = MACRO/CRDLABEL, PLBL1, PLBL2, PLBL3, PLBL4, PLBL5, PLBL6
DECL/LOCAL, DOUBLE, PTMEAS_1[6],PTMEAS_4[6],PTMEAS_5[6],PTMEAS_6[6], PRDIAM
DECL/LOCAL, INTGR, RETVAL
DECL/LOCAL, INTGR, ISPRCOMP
DECL/LOCAL, CHAR, 255, SLBL
ISPRCOMP = VALUE/PRCOMP

IF/(ISPRCOMP .EQ. 1)
PRCOMP/OFF
ENDIF

CALL/M(EASI_GET_PTMEAS_AT), (PLBL1), 1, PTMEAS_1[1], PTMEAS_1[2], PTMEAS_1[3], $
PTMEAS_1[4], PTMEAS_1[5], PTMEAS_1[6], RETVAL
CALL/M(EASI_GET_PTMEAS_AT), (PLBL4), 1, PTMEAS_4[1], PTMEAS_4[2], PTMEAS_4[3], $
PTMEAS_4[4], PTMEAS_4[5], PTMEAS_4[6], RETVAL
CALL/M(EASI_GET_PTMEAS_AT), (PLBL5), 1, PTMEAS_5[1], PTMEAS_5[2], PTMEAS_5[3], $
PTMEAS_5[4], PTMEAS_5[5], PTMEAS_5[6], RETVAL
CALL/M(EASI_GET_PTMEAS_AT), (PLBL6), 1, PTMEAS_6[1], PTMEAS_6[2], PTMEAS_6[3], $
PTMEAS_6[4], PTMEAS_6[5], PTMEAS_6[6], RETVAL

F(TMPPLN) = FEAT/PLANE, CART, 0,0,0, PTMEAS_1[4],PTMEAS_1[5],PTMEAS_1[6]
CONST/PLANE, F(TMPPLN), BF, FA(PLBL1)[1], FA(PLBL2)[1], FA(PLBL3)[1]
F(TMPLN) = FEAT/LINE, UNBND, CART, 0,0,0, PTMEAS_5[1]-PTMEAS_4[1], $
PTMEAS_5[2]-PTMEAS_4[2], PTMEAS_5[3]-PTMEAS_4[3], $
PTMEAS_4[4], PTMEAS_4[5], PTMEAS_4[6]
CONST/LINE, F(TMPLN), BF, FA(PLBL4)[1], FA(PLBL5)[1]
F(TMPPT) = FEAT/POINT,CART,PTMEAS_6[1], PTMEAS_6[2], PTMEAS_6[3], $
PTMEAS_6[4], PTMEAS_6[6], PTMEAS_6[6]

D(CRDLABEL) =DATSET/FA(TMPPLN), ZDIR, ZORIG
D(CRDLABEL) =ROTATE/ZAXIS, FA(TMPLN), XDIR
D(CRDLABEL) =TRANS/YORIG, FA(TMPLN), XORIG, F(TMPPT)
SLBL =VALUE/SNSLCT
PRDIAM =OBTAIN/SS(SLBL), 8
D(CRDLABEL) =TRANS/XORIG, PRDIAM/2, YORIG, PRDIAM/2, ZORIG, -PRDIAM/2
IF/(ISPRCOMP .EQ. 1)
PRCOMP/ON
ENDIF

ENDMAC

$$ Sample calling statement
CALL/M(EASI_6PT_TO_CRD), (CRD1),(PT1),(PT2),(PT3),(PT4),(PT5),(PT6)
$$ Set.CAD2PCS.CADM_1
MODE/PROG,MAN
$$ MACRO: EASI_CLEARPLN_GOTO
$$ FUNCTION: CLEARANCE SURFACE IMPLEMENTATION
$$ Move machine CLEAR SURFACE DIST above the current clear surface
$$ plane and then move machine parallel to the clear surface plane
$$ ALL Macro parameters are in PCS and Current UNITS
$$ Last update: 3-1-04 Add mode checking. only works in PROG MODE
$$ Last update: 8-24-04 Clear position is based on the surface of
$$
$$ This sample DMIS Macro is provided by External-Array Software, Inc.
$$ It should be modified for your own use. There is no guarantee for
$$ the quality of this Macro. November, 2003

M(EASI_CLEARPLN_GOTO) = MACRO/ISNOM, TARX, TARY, TARZ
DECL/LOCAL, REAL, CCX, CCY, CCZ, CCI, CCJ, CCK
DECL/LOCAL, REAL, CURX, CURY, CURZ, TD, CLRDIST, SDIAM
DECL/LOCAL, CHAR, 255, CLRLABEL, FLABEL, MMODE, SNAME

MMODE = VALUE/MODE
CLRLABEL = VALUE/SNSET, CLRSRF

IF/ ( (LEN(CLRLABEL) .GT. 0) .AND. (MMODE .EQ. PROG,MAN) )
CLRDIST = VALUE/SNSET, CLRSRF, DIST
FLABEL = ASSIGN/FA
IF/ ISNOM .EQ. 0
FLABEL = ASSIGN/F
ENDIF

CCX = OBTAIN/FLABEL(@CLRLABEL), 3
CCY = OBTAIN/FLABEL(@CLRLABEL), 4
CCZ = OBTAIN/FLABEL(@CLRLABEL), 5
CCI = OBTAIN/FLABEL(@CLRLABEL), 6
CCJ = OBTAIN/FLABEL(@CLRLABEL), 7
CCK = OBTAIN/FLABEL(@CLRLABEL), 8

SNAME = VALUE/SNSLCT
SDIAM = OBTAIN/SS(SNAME), 8
CCX = ASSIGN/CCX + CCI * SDIAM/2
CCY = ASSIGN/CCY + CCJ * SDIAM/2
CCZ = ASSIGN/CCZ + CCK * SDIAM/2

CURX = VALUE/GOTOM, XAXIS
CURY = VALUE/GOTOM, YAXIS
CURZ = VALUE/GOTOM, ZAXIS

TD = ASSIGN/(CURX - CCX) * CCI + (CURY - CCY) * CCJ + (CURZ - CCZ) * CCK
IF/ TD .LT. CLRDIST
TD = ASSIGN/(CLRDIST - TD)
GOTO/CURX+CCI*TD, CURY+CCJ*TD, CURZ+CCK*TD
ENDIF

TD = ASSIGN/(TARX - CCX) * CCI + (TARY - CCY) * CCJ + (TARZ - CCZ) * CCK
IF/ TD .LT. CLRDIST
TD = ASSIGN/(CLRDIST - TD)
GOTO/TARX+CCI*TD, TARY+CCJ*TD, TARZ+CCK*TD
ENDIF
ENDIF

ENDMAC
SNSET/APPRCH, 2.0000
SNSET/RETRCT, 2.0000
SNSET/DEPTH, 0.0000
SNSET/SEARCH, 10.0000
SNSET/CLRSRF, FA(EA_XYPLANE), 20.0000
F(基准A)=FEAT/PLANE,CART,105.3981,148.7333,0,0.0000,0.0000,1.0000
$$ Measurement points are created through nominal points
$$ CALL/M(EASI_CLEARPLN_GOTO), 1, -2.5926, 20.7355, 20.4999
MEAS/PLANE, F(基准A), 12
GOTO/CART, -2.5926, 20.7355, 20.4999
GOTO/CART, 7.9670, 39.5633, 20.4999
PTMEAS/CART, 7.9670, 39.5633, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 80.1911, 7.6656, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 150.0902, 35.5371, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 222.9874, 39.0934, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 120.4700, 108.5651, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 17.5318, 116.0495, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 13.3736, 188.0375, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 127.3722, 194.7709, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 239.5172, 253.6297, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 169.9482, 269.0879, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 103.5484, 268.9009, 0.0000, -0.0000, 0.0000, 1.0000
PTMEAS/CART, 11.7421, 263.8613, 0.0000, -0.0000, 0.0000, 1.0000
ENDMES
D(CRD2) = DATSET/FA(基准A), ZDIR
F(基准B)=FEAT/LINE,BND,CART,33.7420,-0.0014,-4.0027,154.9573,-0.0011,-4.0055,0.0000,-1.0000,0.0000
$$ Measurement points are created through nominal points
$$ CALL/M(EASI_CLEARPLN_GOTO), 1, 11.7447, 263.8638, 20.4999
MEAS/LINE, F(基准B), 5
GOTO/CART, 11.7447, 263.8638, 20.4999
GOTO/CART, 33.7416, -2.4991, 20.4999
PTMEAS/CART, 33.7416, 0.0008, -4.0000, 0.0000, -1.0000, -0.0002
PTMEAS/CART, 65.6308, 0.0008, -4.0000, 0.0000, -1.0000, -0.0002
PTMEAS/CART, 93.9077, 0.0008, -4.0000, 0.0000, -1.0000, -0.0002
PTMEAS/CART, 128.1219, 0.0010, -4.0000, 0.0000, -1.0000, -0.0002
PTMEAS/CART, 154.9591, 0.0008, -4.0000, 0.0000, -1.0000, -0.0002
ENDMES
F(基准C)=FEAT/LINE,BND,CART,-0.0019,37.3655,-4.0007,0.0215,269.2210,-4.0038,-1.0000,0.0001,-0.0000
$$ Measurement points are created through nominal points
$$ CALL/M(EASI_CLEARPLN_GOTO), 1, 154.9606, -2.4960, 20.4999
MEAS/LINE, F(基准C), 6
GOTO/CART, 154.9606, -2.4960, 20.4999
GOTO/CART, -2.4998, 37.3619, 20.4999
PTMEAS/CART, 0.0000, 37.3619, -4.0000, -1.0000, -0.0000, 0.0000
PTMEAS/CART, 0.0000, 81.1468, -4.0000, -1.0000, -0.0000, 0.0000
PTMEAS/CART, 0.0000, 129.9684, -4.0000, -1.0000, -0.0000, 0.0000
PTMEAS/CART, 0.0000, 182.4769, -4.0000, -1.0000, -0.0000, 0.0000
PTMEAS/CART, 0.0000, 232.2037, -4.0000, -1.0000, -0.0000, 0.0000
PTMEAS/CART, 0.0000, 269.2181, -4.0000, -1.0000, -0.0000, 0.0000
ENDMES
F(PT_INTER1)=FEAT/POINT,CART,-0.0057,-0.0015,-4.0011,0.0000,0.0000,1.0000
CONST/POINT,F(PT_INTER1),INTOF,FA(基准B),FA(基准C)
D(CRD3) = DATSET/FA(基准A), ZDIR, ZORIG, FA(基准B), XDIR, FA(PT_INTER1), XORIG
D(CRD3) = TRANS/ZORIG, -0, YORIG, FA(PT_INTER1), XORIG, -0
$$ Set.CAD2PCS.CADM_1
F(基准A)=FEAT/PLANE,CART,105.3981,148.7333,0,0.0000,0.0000,1.0000
F(基准B)=FEAT/LINE,BND,CART,33.7420,-0.000,-4.0027,154.9573,-0.000,-4.0055,0.0000,-1.0000,0.0000
F(基准C)=FEAT/LINE,BND,CART,-0.000,37.3655,-4.0007,0.000,269.2210,-4.0038,-1.0000,0.0000,-0.0000
MODE/PROG,MAN
SNSET/APPRCH, 2.0000
SNSET/RETRCT, 2.0000
SNSET/DEPTH, 0.0000
SNSET/SEARCH, 10.0000
SNSET/CLRSRF, FA(基准A), 20.0000
F(MP-1)=FEAT/POINT,CART,8.6130,38.2484,-0.0000,-0.0000,0.0000,1.0000
F(MP-2)=FEAT/POINT,CART,42.6062,29.0126,-0.0000,-0.0000,0.0000,1.0000
F(MP-3)=FEAT/POINT,CART,83.7920,8.2614,-0.0000,-以上是关于RationalDMIS 7.1 高级编程2020的主要内容,如果未能解决你的问题,请参考以下文章

RationalDMIS 7.1 取最大值

RationalDMIS 7.1 CASE分支选择语句之循环选择测量孔

RationalDMIS 2020测量平面

RationalDMIS 2020 圆测点计算

RationalDMIS2020 模型坐标系转换

RationalDMiS 2020测头补偿