首页/文章/ 详情

RationalDMIS子程序调用

1年前浏览547

RationalDMIS子程序调用

DMISMN/'Created by [山涧果子] on 星期六, 七月 15, 2017', 4.0

UNITS/MM, ANGDEC

WKPLAN/XYPLAN

PRCOMP/ON

TECOMP/ON

FLY/1.000000

MODE/PROG, MAN

SNSET/APPRCH, 3.000000

SNSET/RETRCT, 3.000000

SNSET/DEPTH, 0.000000

SNSET/SEARCH, 10.000000

SNSET/CLRSRF, 30.000000

RECALL/D(MCS)

SNSLCT/S(ROOTSN1)

GEOALG/CIRCLE, LSTSQR

GEOALG/ARC, LSTSQR

GEOALG/PLANE, LSTSQR

$$

$$

(MENU)

DECL/COMMON,INTGR,V1,V2,V3,V4,V5,V6

Lenovo = PROMPT/TITLE,'山涧果子 ',TEXT,'构建坐标系,模型对齐!',CHECK,'1',$

V1,TEXT,'测量中心大圆!',CHECK,'2',V2,TEXT,'测量均布四个小圆!',CHECK,'3',$

V3,TEXT,'测量圆键槽!',CHECK,'4',V4,TEXT,'测量点集',CHECK,'5',V5,TEXT,$

'退出(结束测量)',CHECK,'6',V6

IF/(V1.EQ.1)

JUMPTO/(ALIGNMENT)

ELSE

IF/(V2.EQ.1)

JUMPTO/(SMALL_CIRCLES)

ELSE

IF/(V3.EQ.1)

JUMPTO/(LARGE_CIRCLE)

ELSE

IF/(V4.EQ.1)

JUMPTO/(ROUND_SLOT)

ELSE

IF/(V5.EQ.1)

JUMPTO/(POINTS)

ELSE

IF/(V6.EQ.1)

JUMPTO/(END)

ENDIF

ENDIF

ENDIF

ENDIF

ENDIF

ENDIF

(ALIGNMENT)

MODE/MAN

F(PLN1) = FEAT/PLANE,CART, 32.082523, 76.014419, 62.490748, 0.000181,$

 -0.000070, 1.000000

$$ Measurement points are created through actual points

MEAS/PLANE, F(PLN1), 4

  PTMEAS/CART,  4.050106, 43.806519, 62.493564, 0.000181, -0.000070, 1.000000

  PTMEAS/CART,  52.285087, 43.221539, 62.484785, 0.000181, -0.000070, 1.000000

  PTMEAS/CART,  53.696995, 96.819366, 62.488293, 0.000181, -0.000070, 1.000000

  PTMEAS/CART,  18.297903, 120.210251, 62.496349, 0.000181, -0.000070, 1.000000

ENDMES

OUTPUT/FA(PLN1)

F(LN1) = FEAT/LINE,BND,CART, 1.957149, -0.000029, 43.501493, 42.885566,$

 -0.000049, 44.036092, 0.000000, -1.000000, -0.000070

$$ Measurement points are created through actual points

MEAS/LINE, F(LN1), 2

  PTMEAS/CART,  1.957149, -0.000029, 43.501493, 0.000000, -1.000000, -0.000070

  PTMEAS/CART,  42.885566, -0.000049, 44.036092, 0.000000, -1.000000, -0.000070

ENDMES

OUTPUT/FA(LN1)

F(LN2) = FEAT/LINE,BND,CART, 0.000000, 43.615447, 60.500315, 0.000000,$

 106.140746, 57.549547, -1.000000, 0.000009, 0.000181

$$ Measurement points are created through actual points

MEAS/LINE, F(LN2), 2

  PTMEAS/CART,  -0.000000, 43.615447, 60.500315, -1.000000, 0.000009, 0.000181

  PTMEAS/CART,  -0.000000, 106.140746, 57.549547, -1.000000, 0.000009, 0.000181

ENDMES

OUTPUT/FA(LN2)

F(PT_INTER1) = FEAT/POINT,CART, 0.124329, 0.449182, 52.997723, -0.013046,$

 0.047137, 0.998803

CONST/POINT, F(PT_INTER1), INTOF, FA(LN1), FA(LN2)

OUTPUT/FA(PT_INTER1)

D(CRD1) = DATSET/FA(PLN1), ZDIR, ZORIG, FA(LN1), XDIR, YORIG, FA(PT_INTER1),$

 XORIG

D(CRD1) = TRANS/ZORIG, -62.5000, YORIG, -0, XORIG, -0

$$ Set.CAD2PCS.CADM_1

$$ Set.CADViewCenter.CADM_1

JUMPTO/(MENU)

MODE/PROG,MAN

(SMALL_CIRCLES)

$$ 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/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, 3.0000

SNSET/RETRCT, 3.0000

SNSET/DEPTH, 0.0000

SNSET/SEARCH, 10.0000

SNSET/CLRSRF, F(PLN1), 30.0000

F(SMALL_CIRCLES) = FEAT/CIRCLE,INNER,CART, 29.629035, 95.494885, 62.485214,$

 0.000357, -0.000101, 1.000000, 25.391735

$$ Measurement points are created through nominal points

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, -4.993488, 106.138230, 93.499581

MEAS/CIRCLE, F(SMALL_CIRCLES), 4

  GOTO/CART,  -4.993488, 106.138230, 93.499581

  GOTO/CART,  38.335798, 95.491789, 93.490984

  GOTO/CART,  38.335615, 95.491860, 92.482107

  PTMEAS/CART,  42.324902, 95.494886, 62.480681, -1.000000, 0.000000, 0.000400

  GOTO/CART,  37.662968, 92.167121, 62.482010

  GOTO/CART,  35.777942, 89.345979, 62.482398

  GOTO/CART,  32.956799, 87.460951, 62.483216

  PTMEAS/CART,  29.629035, 82.799018, 62.483934, 0.000000, 1.000000, 0.000100

  GOTO/CART,  26.301271, 87.460951, 62.485592

  GOTO/CART,  23.480129, 89.345978, 62.486790

  GOTO/CART,  21.595101, 92.167120, 62.487748

  PTMEAS/CART,  16.933168, 95.494884, 62.489748, 1.000000, 0.000000, -0.000400

  GOTO/CART,  21.595101, 98.822649, 62.488419

  GOTO/CART,  23.480128, 101.643791, 62.488030

  GOTO/CART,  26.301270, 103.528819, 62.487213

  PTMEAS/CART,  29.629034, 108.190752, 62.486495, 0.000000, -1.000000, -0.000100

  GOTO/CART,  29.639748, 104.187727, 92.486089

ENDMES

OUTPUT/FA(SMALL_CIRCLES)

JUMPTO/(MENU)

(LARGE_CIRCLE)

SNSET/APPRCH, 3.0000

SNSET/RETRCT, 3.0000

SNSET/DEPTH, 0.0000

SNSET/SEARCH, 10.0000

SNSET/CLRSRF, F(PLN1), 30.0000

F(LARGE_CIRCLE1) = FEAT/CIRCLE,INNER,CART, 47.599750, 77.533498, 62.483527,$

 -0.001170, -0.000997, 0.999999, 9.526483

$$ Measurement points are created through nominal points

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 29.639930, 104.187656, 93.493170

MEAS/CIRCLE, F(LARGE_CIRCLE1), 4

  GOTO/CART,  29.639930, 104.187656, 93.493170

  GOTO/CART,  48.328065, 77.503514, 93.487910

  GOTO/CART,  48.327883, 77.503584, 92.484385

  PTMEAS/CART,  52.362988, 77.533493, 62.489101, -0.999999, 0.000000, -0.001200

  PTMEAS/CART,  47.599751, 72.770259, 62.478778, 0.000000, 1.000000, 0.001000

  PTMEAS/CART,  42.836512, 77.533503, 62.477953, 0.999999, 0.000000, 0.001200

  PTMEAS/CART,  47.599749, 82.296737, 62.488276, 0.000000, -1.000000, -0.001000

  GOTO/CART,  47.564642, 78.266826, 92.484253

ENDMES

OUTPUT/FA(LARGE_CIRCLE1)

F(LARGE_CIRCLE2) = FEAT/CIRCLE,INNER,CART, 47.591675, 113.457218, 62.483108,$

 0.000715, -0.001658, 0.999998, 9.521386

$$ Measurement points are created through nominal points

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 47.564824, 78.266755, 93.488102

MEAS/CIRCLE, F(LARGE_CIRCLE2), 4

  GOTO/CART,  47.564824, 78.266755, 93.488102

  GOTO/CART,  48.374009, 113.407395, 93.490424

  GOTO/CART,  48.373827, 113.407466, 92.482515

  PTMEAS/CART,  52.352367, 113.457224, 62.479703, -1.000000, 0.000000, 0.000700

  PTMEAS/CART,  47.591676, 108.696532, 62.475213, 0.000000, 0.999999, 0.001700

  PTMEAS/CART,  42.830983, 113.457212, 62.486513, 1.000000, 0.000000, -0.000700

  PTMEAS/CART,  47.591675, 118.217904, 62.491003, 0.000000, -0.999999, -0.001700

  GOTO/CART,  47.613134, 114.168157, 92.484320

ENDMES

OUTPUT/FA(LARGE_CIRCLE2)

F(LARGE_CIRCLE3) = FEAT/CIRCLE,INNER,CART, 11.672732, 113.459471, 62.495001,$

 0.000610, -0.000461, 1.000000, 9.517758

$$ Measurement points are created through nominal points

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 47.613316, 114.168086, 93.490615

MEAS/CIRCLE, F(LARGE_CIRCLE3), 4

  GOTO/CART,  47.613316, 114.168086, 93.490615

  GOTO/CART,  12.450083, 113.445569, 93.496934

  GOTO/CART,  12.449902, 113.445639, 92.494530

  PTMEAS/CART,  16.431610, 113.459472, 62.492100, -1.000000, 0.000000, 0.000600

  PTMEAS/CART,  11.672732, 108.700593, 62.492807, 0.000000, 1.000000, 0.000500

  PTMEAS/CART,  6.913854, 113.459470, 62.497903, 1.000000, 0.000000, -0.000600

  PTMEAS/CART,  11.672733, 118.218349, 62.497196, -0.000000, -1.000000,$

 -0.000500

  GOTO/CART,  11.691023, 114.204518, 92.495343

ENDMES

OUTPUT/FA(LARGE_CIRCLE3)

F(LARGE_CIRCLE4) = FEAT/CIRCLE,INNER,CART, 11.664848, 77.534322, 62.489405,$

 0.000340, -0.000125, 1.000000, 9.511912

$$ Measurement points are created through nominal points

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 11.691204, 114.204448, 93.497125

MEAS/CIRCLE, F(LARGE_CIRCLE4), 4

  GOTO/CART,  11.691204, 114.204448, 93.497125

  GOTO/CART,  12.431179, 77.530504, 93.494415

  GOTO/CART,  12.430997, 77.530575, 92.489146

  PTMEAS/CART,  16.420804, 77.534322, 62.487789, -1.000000, 0.000000, 0.000300

  PTMEAS/CART,  11.664848, 72.778366, 62.488811, 0.000000, 1.000000, 0.000100

  PTMEAS/CART,  6.908893, 77.534322, 62.491021, 1.000000, 0.000000, -0.000300

  PTMEAS/CART,  11.664849, 82.290278, 62.489999, -0.000000, -1.000000, -0.000100

  GOTO/CART,  11.675041, 78.286531, 92.489498

ENDMES

OUTPUT/FA(LARGE_CIRCLE4)

JUMPTO/(MENU)

(ROUND_SLOT)

SNSET/APPRCH, 3.0000

SNSET/RETRCT, 3.0000

SNSET/DEPTH, 0.0000

SNSET/SEARCH, 10.0000

SNSET/CLRSRF, F(PLN1), 30.0000

F(SLT1) = FEAT/CPARLN,INNER,ROUND,CART, 30.052095, 54.653468, 62.480866,$

 0.000308, -0.000098, 1.000000, 0.999991, 0.004228, -0.000307, 50.125917,$

 12.769768

$$ Measurement points are created through nominal points

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 11.675223, 78.286460, 93.494605

MEAS/CPARLN, F(SLT1), 6

  GOTO/CART,  11.675223, 78.286460, 93.494605

  GOTO/CART,  39.382356, 58.075626, 93.488166

  PTMEAS/CART,  39.364055, 61.077777, 62.478631, 0.004200, -0.999991, -0.000100

  PTMEAS/CART,  20.686148, 60.998812, 62.484374, 0.004200, -0.999991, -0.000100

  PTMEAS/CART,  4.989361, 54.547509, 62.488572, 0.999991, 0.004200, -0.000300

  PTMEAS/CART,  20.740134, 48.229158, 62.483101, -0.004200, 0.999991, 0.000100

  PTMEAS/CART,  39.418042, 48.308123, 62.477358, -0.004200, 0.999991, 0.000100

  PTMEAS/CART,  55.114828, 54.759426, 62.473160, -0.999991, -0.004200, 0.000300

ENDMES

OUTPUT/FA(SLT1)

JUMPTO/(MENU)

(POINTS)

SNSET/APPRCH, 3.0000

SNSET/RETRCT, 3.0000

SNSET/DEPTH, 0.0000

SNSET/SEARCH, 10.0000

SNSET/CLRSRF, F(PLN1), 30.0000

F(PT1) = FEAT/POINT,CART, 19.685307, 16.177397, 62.488791, 0.000181,$

 -0.000070, 1.000000

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 19.686031, 16.177116, 66.488791

MEAS/POINT, F(PT1), 1

  GOTO/CART,  19.690922, 16.175219, 93.488791

  PTMEAS/CART,  19.685307, 16.177397, 62.488791, 0.000181, -0.000070, 1.000000

ENDMES

F(PT2) = FEAT/POINT,CART, 5.136687, 44.584263, 62.486866, 0.000362,$

 -0.000140, 1.000000

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 5.138136, 44.583701, 66.486866

MEAS/POINT, F(PT2), 1

  GOTO/CART,  5.143029, 44.581804, 93.493421

  PTMEAS/CART,  5.136687, 44.584263, 62.486866, 0.000362, -0.000140, 1.000000

ENDMES

F(PT3) = FEAT/POINT,CART, 51.539172, 44.140194, 62.469991, 0.000362,$

 -0.000140, 1.000000

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 51.540621, 44.139633, 66.469991

MEAS/POINT, F(PT3), 1

  GOTO/CART,  51.545515, 44.137735, 93.484984

  PTMEAS/CART,  51.539172, 44.140194, 62.469991, 0.000362, -0.000140, 1.000000

ENDMES

F(PT4) = FEAT/POINT,CART, 52.484192, 87.793770, 62.475781, 0.000362,$

 -0.000140, 1.000000

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 52.485641, 87.793208, 66.475781

MEAS/POINT, F(PT4), 1

  GOTO/CART,  52.490534, 87.791311, 93.487879

  PTMEAS/CART,  52.484192, 87.793770, 62.475781, 0.000362, -0.000140, 1.000000

ENDMES

F(PT5) = FEAT/POINT,CART, 36.424607, 116.441673, 62.485624, 0.000362,$

 -0.000140, 1.000000

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 36.426056, 116.441111, 66.485623

MEAS/POINT, F(PT5), 1

  GOTO/CART,  36.430948, 116.439214, 93.492800

  PTMEAS/CART,  36.424607, 116.441673, 62.485624, 0.000362, -0.000140, 1.000000

ENDMES

F(PT6) = FEAT/POINT,CART, 9.062191, 95.266464, 62.492563, 0.000362,$

 -0.000140, 1.000000

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 9.063640, 95.265902, 66.492563

MEAS/POINT, F(PT6), 1

  GOTO/CART,  9.068532, 95.264006, 93.496270

  PTMEAS/CART,  9.062191, 95.266464, 62.492563, 0.000362, -0.000140, 1.000000

ENDMES

F(PT7) = FEAT/POINT,CART, 30.077091, 70.954735, 62.481534, 0.000362,$

 -0.000140, 1.000000

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 30.078540, 70.954173, 66.481534

MEAS/POINT, F(PT7), 1

  GOTO/CART,  30.083433, 70.952276, 93.490755

  PTMEAS/CART,  30.077091, 70.954735, 62.481534, 0.000362, -0.000140, 1.000000

ENDMES

F(PT8) = FEAT/POINT,CART, 25.303820, 116.631279, 62.489680, 0.000362,$

 -0.000140, 1.000000

$$ CALL/M(EASI_CLEARPLN_GOTO), 0, 25.305269, 116.630717, 66.489679

MEAS/POINT, F(PT8), 1

  GOTO/CART,  25.310161, 116.628820, 93.494828

  PTMEAS/CART,  25.303820, 116.631279, 62.489680, 0.000362, -0.000140, 1.000000

ENDMES

JUMPTO/(MENU)

(END)


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