首页/文章/ 详情

RationalDMIS脱机编程

1年前浏览5041

提示:


     对于脱机编程,使用平面,圆,圆,构建坐标系的。
 
    如果两圆需要构造中分点,在元素数据区,拖放圆实测值到点节点,构造套用点(
把圆心做成点也行 以前都这么解决),两点构造中分点作为原点。最佳拟合直线,作为旋转轴。

或者使用构造投影,构造投影点!

    如果使用圆,圆构造中分点,脱机编程,实际测量时发现两圆孔往一个轴向偏差几毫米!两圆构造中分时,软件界面有三个点可供选择。
DMIS构造时有多种选择时,dmis选结果是优先选离理论近的。


建议使用圆套用点,然后构造中分点,解决构造歧义!

在此感谢爱科腾瑞傅海鑫以及雷顿中国黄利的帮助!

 示例:

发动机托盘下方旋转V形轮,工艺基准为中间直径为360孔。

DMISMN/'Created by [天永智能装备股份有限公司] on 星期一, 七月 03, 2017', 4.0

UNITS/MM, ANGDEC

WKPLAN/XYPLAN

PRCOMP/ON

TECOMP/ON

FLY/1.0

MODE/PROG, MAN

SNSET/APPRCH, 4.000000

SNSET/RETRCT, 4.000000

SNSET/DEPTH, 0.000000

SNSET/SEARCH, 10.000000

SNSET/CLRSRF, 50.000000

RECALL/D(MCS)

SNSLCT/S(20-30X2)

GEOALG/CIRCLE, LSTSQR

GEOALG/ARC, LSTSQR

GEOALG/PLANE, LSTSQR

$$

$$

TEXT/OPER, '粗建坐标系!!'

$$

$$

MODE/MAN

TEXT/OPER, '在基准平面,最大范围策略四点,找正第一轴向!!'

F(PLN1) = FEAT/PLANE,CART, -120.3357, -0.0000, -0.0000, 0.000000, 0.000000,$

 1.000000

$$ Empty Meas Block

MEAS/PLANE, F(PLN1), 4

ENDMES

D(CRD1) = DATSET/FA(PLN1), ZDIR

D(CRD1) = TRANS/ZORIG, FA(PLN1)

F(CIR1) = FEAT/CIRCLE,INNER,CART, -115.0000, 165.0000, 0.0000, 0.000000,$

 0.000000, 1.000000, 12.0000

$$ Empty Meas Block

MEAS/CIRCLE, F(CIR1), 4

ENDMES

F(CIR2) = FEAT/CIRCLE,INNER,CART, 115.0000, -165.0000, 0.0000, 0.000000,$

 0.000000, 1.000000, 12.0000

$$ Empty Meas Block

MEAS/CIRCLE, F(CIR2), 4

ENDMES

F(PT1) = FEAT/POINT,CART, -115.0000, 165.0000, 0.0000, 0.000000, 0.000000,$

 1.000000

$$ 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. July, 2009

$$ Last update: March 7, 2010

$$ When PINDEX = 0, define POINT through feature's

$$ characteristic point

$$ FUNCION: The function retrieves the X,Y,Z,I,J,K of measurement

$$ point from feature 'FEATLABEL' at index PINDEX.

$$ The X,Y,Z,I,J,K are used to define a new point of 'POINTLABEL'

$$ DERR is 0 if the PINDEX is in valid range and point actual

$$ is defined. If DERR is 1, the PINDEX is greater than the

$$ maximum index range.

M(EASI_DEFINE_INDEXED_POINT) = MACRO/'FEATLABEL', 'POINTLABEL', PINDEX, DERR

DECL/LOCAL, REAL, PX, PY, PZ, PI, PJ, PK

DECL/LOCAL, INTGR, PSIZE, INDEX1

DECL/LOCAL, CHAR, 255, FNAME

PSIZE = VALUE/FA(@FEATLABEL), PTDATA

DERR = ASSIGN/1

IF/( PINDEX .EQ. 0 )

CALL/M(EASI_GETX_INDEX), FEATLABEL, INDEX1

PX = OBTAIN/FA(@FEATLABEL),INDEX1

PY = OBTAIN/FA(@FEATLABEL),INDEX1+1

PZ = OBTAIN/FA(@FEATLABEL),INDEX1+2

FNAME = OBTAIN/F(@FEATLABEL), 1

IF/( (FNAME .EQ. 'ELLIPS') .OR. (FNAME .EQ. 'SPHERE') )

PI = 0

PJ = 0

PK = 1

ELSE

PI = OBTAIN/FA(@FEATLABEL),INDEX1+3

PJ = OBTAIN/FA(@FEATLABEL),INDEX1+4

PK = OBTAIN/FA(@FEATLABEL),INDEX1+5

ENDIF

FA(@POINTLABEL) = FEAT/POINT, CART, PX, PY, PZ, PI, PJ, PK

DERR = ASSIGN/0

ELSE

IF/( PSIZE .GE. PINDEX )

PX = OBTAIN/FA(@FEATLABEL)[PINDEX], 2

PY = OBTAIN/FA(@FEATLABEL)[PINDEX], 3

PZ = OBTAIN/FA(@FEATLABEL)[PINDEX], 4

PI = OBTAIN/FA(@FEATLABEL)[PINDEX], 5

PJ = OBTAIN/FA(@FEATLABEL)[PINDEX], 6

PK = OBTAIN/FA(@FEATLABEL)[PINDEX], 7

FA(@POINTLABEL) = FEAT/POINT, CART, PX, PY, PZ, PI, PJ, PK

DERR = ASSIGN/0

ENDIF

ENDIF

ENDMAC

CALL/M(EASI_DEFINE_INDEXED_POINT), (CIR1), (PT1), 0, KNPTR1

F(PT2) = FEAT/POINT,CART, 115.0000, -165.0000, 0.0000, 0.000000, 0.000000,$

 1.000000

CALL/M(EASI_DEFINE_INDEXED_POINT), (CIR2), (PT2), 0, KNPTR1

$$ CREATED BY : External-Array Software, Inc

$$ DATE : Jan 19, 2009

$$ 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 doesn't not 

$$ guarantee the quality of this Macro.

$$ FUNCION: Create a nominal line using two actual features

$$ DI, DJ, DK are the normal vector of the plane that the line lies on

M(EASI_2PT_TO_LINE) = Macro/'FEAT1', 'FEAT2', 'FEATLINE', DI, DJ, DK

DECL/LOCAL,DOUBLE,DVALUE[6]

    DECL/LOCAL,INTGR, INDEX1, INDEX2

    

    CALL/M(EASI_GETX_INDEX), FEAT1, INDEX1

    CALL/M(EASI_GETX_INDEX), FEAT2, INDEX2

    

DVALUE[1] = OBTAIN/FA(@FEAT1),INDEX1

DVALUE[2] = OBTAIN/FA(@FEAT1),INDEX1+1

DVALUE[3] = OBTAIN/FA(@FEAT1),INDEX1+2

      

DVALUE[4] = OBTAIN/FA(@FEAT2),INDEX2

DVALUE[5] = OBTAIN/FA(@FEAT2),INDEX2+1

DVALUE[6] = OBTAIN/FA(@FEAT2),INDEX2+2

      

    F(@FEATLINE) = FEAT/LINE,BND,CART,DVALUE[1],DVALUE[2],DVALUE[3],$

                                      DVALUE[4],DVALUE[5],DVALUE[6],$

                                      DI, DJ, DK

ENDMAC

CALL/M(EASI_2PT_TO_LINE),(PT1),(PT2),(BFLN1), 0.000000, 0.000000, 1.000000

CONST/LINE,F(BFLN1),BF,FA(PT1),FA(PT2)

F(MIDPT1) = FEAT/POINT,CART, -0.0000, -0.0000, 0.0000, 0.000000, 0.000000,$

 1.000000

CONST/POINT, F(MIDPT1), MIDPT, FA(PT1), FA(PT2)

D(CRD2) = ROTATE/ZAXIS, FA(BFLN1), XDIR

D(CRD3) = TRANS/XORIG, FA(MIDPT1), YORIG, FA(MIDPT1)

D(CRD4) = ROTATE/ZAXIS, RTOD(ATAN2(330/2,230/2))

$$ Set.CAD2PCS.CADM_1

$$ Set.CADViewCenter.CADM_1

TEXT/OPER, '请将测头移动到安全位置!!'

$$

MODE/PROG,MAN

GOTO/0.000000, 0.000000, 200.000000

$$ 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

$$ FUNCION: Move machine CLEAR DIST above the current clear surface 

$$ plane and then move machine parallel to the clear surface

$$ plane to the project point of POINT(TARX, TARY, TARZ) on 

$$ the clear surface plane but CLEAR DIST above the 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

$$ ruby ball instead of the center of it.

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/GOTO, XAXIS

CURY = VALUE/GOTO, YAXIS

CURZ = VALUE/GOTO, 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, 6

SNSET/RETRCT, 6

SNSET/DEPTH, 0.0000

SNSET/SEARCH, 10.0000

SNSET/CLRSRF, 50

F(PLN_A) = FEAT/PLANE,CART, -120.3357, -0.0000, -0.0000, 0.000000, 0.000000,$

 1.000000

$$ Measurement points are created through nominal points

MEAS/PLANE, F(PLN_A), 24

  GOTO/CART,  87.595735, 180.200624, 50.992132

  PTMEAS/CART,  87.595735, 180.200624, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  51.253549, 216.620149, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -29.817330, 223.429064, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -51.519767, 186.120500, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -122.703330, 189.818269, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -204.284820, 92.462053, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -193.020690, 44.944906, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -224.516051, -34.699000, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -198.009932, -105.888510, 0.000000,  0.000000, 0.000000,$

 1.000000

  PTMEAS/CART,  -178.213088, -89.373404, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -126.730506, -190.706862, 0.000000,  0.000000, 0.000000,$

 1.000000

  PTMEAS/CART,  -76.126044, -180.725050, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -66.376655, -215.582243, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -23.909371, -202.256407, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -12.797547, -229.550261, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  36.785016, -219.676146, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  43.832147, -187.461119, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  81.044190, -177.127196, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  114.791177, -196.163725, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  191.231172, -123.315962, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  184.650498, -66.546324, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  219.789598, -38.703226, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  210.413514, 37.707289, 0.000000,  0.000000, 0.000000, 1.000000

  PTMEAS/CART,  193.624299, 113.266855, 0.000000,  0.000000, 0.000000, 1.000000

ENDMES

GOTO/193.624299, 113.266855, 106.992186

GOTO/0.000000, 0.000000, 150.000000

GOTO/-115.000001, 164.999998, 150.000000

SNSET/APPRCH, 4

SNSET/RETRCT, 4

SNSET/DEPTH, 0.0000

SNSET/SEARCH, 10.0000

SNSET/CLRSRF, 50

F(CIR3) = FEAT/CIRCLE,INNER,CART, -115.0000, 165.0000, -3.0000, 0.000000,$

 0.000000, 1.000000, 12.0000

$$ Measurement points are created through nominal points

MEAS/CIRCLE, F(CIR3), 4

  GOTO/CART,  -115.738049, 164.313646, 47.992132

  GOTO/CART,  -115.738049, 164.313646, 47.000000

  PTMEAS/CART,  -119.393721, 160.914021, -3.000000,  0.732291, 0.680992,$

 0.000000

  PTMEAS/CART,  -119.085980, 169.393720, -3.000000,  0.680992, -0.732291,$

 0.000000

  PTMEAS/CART,  -110.606281, 169.085979, -3.000000,  -0.732291, -0.680992,$

 -0.000000

  PTMEAS/CART,  -110.914022, 160.606280, -3.000000,  -0.680992, 0.732291,$

 0.000000

  GOTO/CART,  -114.313647, 164.261952, 47.000000

ENDMES

GOTO/-115.000001, 164.999998, 150.000000

GOTO/114.999999, -165.000002, 150.000000

F(CIR4) = FEAT/CIRCLE,INNER,CART, 115.0000, -165.0000, -3.0000, 0.000000,$

 0.000000, 1.000000, 12.0000

$$ Measurement points are created through nominal points

MEAS/CIRCLE, F(CIR4), 4

  GOTO/CART,  116.007866, -165.000000, 47.992132

  GOTO/CART,  116.007866, -165.000000, 47.000000

  PTMEAS/CART,  120.999999, -165.000000, -3.000000,  -1.000000, 0.000000,$

 0.000000

  PTMEAS/CART,  114.999999, -171.000000, -3.000000,  0.000000, 1.000000,$

 0.000000

  PTMEAS/CART,  108.999999, -165.000000, -3.000000,  1.000000, 0.000000,$

 0.000000

  PTMEAS/CART,  114.999999, -159.000000, -3.000000,  0.000000, -1.000000,$

 0.000000

  GOTO/CART,  114.999999, -163.992133, 47.000000

ENDMES

GOTO/114.999999, -165.000002, 150.000000

F(PT3) = FEAT/POINT,CART, -115.0000, 165.0000, -3.0000, 0.000000, 0.000000,$

 1.000000

CALL/M(EASI_DEFINE_INDEXED_POINT), (CIR3), (PT3), 0, KNPTR1

F(PT4) = FEAT/POINT,CART, 115.0000, -165.0000, -3.0000, 0.000000, 0.000000,$

 1.000000

CALL/M(EASI_DEFINE_INDEXED_POINT), (CIR4), (PT4), 0, KNPTR1

CALL/M(EASI_2PT_TO_LINE),(PT3),(PT4),(BFLN2), 0.000000, 0.000000, 1.000000

CONST/LINE,F(BFLN2),BF,FA(PT3),FA(PT4)

F(MIDPT2) = FEAT/POINT,CART, -0.0000, -0.0000, -3.0000, 0.000000, 0.000000,$

 1.000000

CONST/POINT, F(MIDPT2), MIDPT, FA(PT3), FA(PT4)

D(CRD5) = DATSET/FA(PLN_A), ZDIR, FA(BFLN2), XDIR, FA(MIDPT2), XORIG

D(CRD5) = TRANS/ZORIG, FA(PLN_A), YORIG, FA(MIDPT2), XORIG, -0

D(CRD6) = ROTATE/ZAXIS, RTOD(ATAN2(330/2,230/2))

$$ Set.CAD2PCS.CADM_1

$$ Set.CADViewCenter.CADM_1

GOTO/0.000000, 0.000000, 200.000000

TEXT/OPER, 'DCC测量正式开始!!'


来源:RationalDMIS测量技术
Marc理论
著作权归作者所有,欢迎分享,未经许可,不得转载
首次发布时间:2023-06-30
最近编辑:1年前
山涧果子
大专 签名征集中
获赞 203粉丝 48文章 1203课程 0
点赞
收藏
未登录
还没有评论
课程
培训
服务
行家
VIP会员 学习 福利任务 兑换礼品
下载APP
联系我们
帮助与反馈