首页/文章/ 详情

RationalDMIS拟合坐标系

1年前浏览210

提示:

   利用程序编辑区模板集成语句EQUATE实现!

   也可以使用拖放式操作,在坐标系根节点鼠标拖放移动前坐标系 CRD1 标签到移动到构建的坐标系 CRD2 标签上,移动前数据会移动到移动后位置,可以继续测量,完成测量任务!





DMIS5.0原文:

    The EQUATE statement creates a transformation from DA(label1) to DA(label2) and updates previously measured features and coordinate systems by the transformation when referenced such that the effect is that previously measured features appear to have been measured in a single part coordinate system.



     The EQUATE statement is used to change the position and/or orientation of a part while retaining previous dimensional information. For example, to measure features on a part that are not accessible from a single part orientation.



     EQUATE语句创立一个从DA(Lable1)到DA(Lable2)的变换,并通过变换更新先前被测量的特征和坐标系,当被引用时以至于效果是先前测量的特征看起来像是一个单一的零件坐标系中被测量过。




主要用来在保持先前尺寸信息的同时改变一个零件的位置或方位。 



The EQUATE statement is passed to the output file when executed.


拟合坐标系简介:

   

   更改零件的位置或方位,同时保留先前的尺寸信息(当工件的尺寸大于测量机的有限尺寸,或是检测时工件需要翻转测量另一面时十分有限)、



  零件在检测过程中出现意外的碰撞或移动,可重新找正零件并保存先前的测定数据。



如下图,


使用平面1,直线1,圆1,建立坐标系CRD1。测量过程中工件不小心发生了移动,这种情况下可以不用重新测量可以使用EQUATE方法将原来的坐标系找回来。

步骤:
  1.重新测量原来的平面,直线和圆,得到平面PLN2,直线LN2,圆2,按着同样的方法建立坐标系。

至此拟合坐标系已经完成。
 
DMISMN/'Created by [山涧果子] on 星期日, 一月 22, 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, 20.000000

RECALL/D(MCS)

SNSLCT/S(ROOTSN1)

GEOALG/CIRCLE, LSTSQR

GEOALG/ARC, LSTSQR

GEOALG/PLANE, LSTSQR

$$

$$

MODE/MAN

F(PLN1) = FEAT/PLANE,CART, 2.500000, 7.500000, 0.000000, 0.000000, 0.000000,$

 1.000000


$$ Empty Meas Block

MEAS/PLANE, F(PLN1), 4


ENDMES

F(LN1) = FEAT/LINE,BND,CART, -35.000000, 40.000000, 0.000000, -35.000000,$

 -90.000000, 0.000000, -1.000000, 0.000000, 0.000000


$$ Empty Meas Block

MEAS/LINE, F(LN1), 2


ENDMES

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

 -0.000000, 1.000000, 30.000000


$$ Empty Meas Block

MEAS/CIRCLE, F(CIR1), 4


ENDMES

D(CRD1) = DATSET/FA(PLN1), ZDIR, FA(LN1), XDIR, FA(CIR1), XORIG

D(CRD1) = TRANS/ZORIG, FA(PLN1), YORIG, FA(CIR1), XORIG, -0

TEXT/OPER, '测量过程中工件不小心发生了移动!!!'

TEXT/OPER, '重新测量原来的平面,直线和圆,按着同样的方法建立坐标系!!'

RECALL/D(MCS)

MODE/MAN

F(PLN2) = FEAT/PLANE,CART, -8.022772, -3.740784, 0.000000, 0.000000,$

 0.000000, 1.000000

$$ Measurement points are created through actual points

MEAS/PLANE, F(PLN2), 4

  PTMEAS/CART,  14.806310, 21.791670, 0.000000, 0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -22.934822, 33.359928, 0.000000, 0.000000, 0.000000, 1.000000

  PTMEAS/CART,  -27.144053, -28.650190, 0.000000, 0.000000, 0.000000, 1.000000

  PTMEAS/CART,  3.181476, -41.464542, 0.000000, 0.000000, 0.000000, 1.000000

ENDMES

OUTPUT/FA(PLN2)

F(LN2) = FEAT/LINE,BND,CART, -35.000000, 23.613592, -2.765160, -35.000000,$

 -71.728935, -3.633093, -1.000000, 0.000000, 0.000000

$$ Measurement points are created through actual points

MEAS/LINE, F(LN2), 2

  PTMEAS/CART,  -35.000000, 23.613592, -2.765160, -1.000000, 0.000000, 0.000000

  PTMEAS/CART,  -35.000000, -71.728935, -3.633093, -1.000000, 0.000000, 0.000000

ENDMES

OUTPUT/FA(LN2)

F(CIR2) = FEAT/CIRCLE,INNER,CART, 0.000000, 0.000000, -2.704232, 0.000000,$

 0.000000, 1.000000, 30.000000

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR2), 4

  PTMEAS/CART,  13.560702, 6.411503, -2.704232, -0.904047, -0.427434, -0.000000

  PTMEAS/CART,  1.079014, -14.961141, -2.704232, -0.071934, 0.997409, -0.000000

  PTMEAS/CART,  -13.056233, -7.384766, -2.704232, 0.870416, 0.492318, -0.000000

  PTMEAS/CART,  -7.685785, 12.881332, -2.704232, 0.512386, -0.858755, -0.000000

ENDMES

OUTPUT/FA(CIR2)

D(CRD2) = DATSET/FA(PLN2), ZDIR, FA(LN2), XDIR, FA(CIR2), XORIG

D(CRD2) = TRANS/ZORIG, FA(PLN2), YORIG, FA(CIR2), XORIG, -0

EQUATE/DA({CRD1}),DA({CRD2})

$$在CRD1下定义/测量的元素会被转移到CRD2下                              注释行

 

实际测量示例:

 
  一个完整测量工件未移动,一个测量即将完成时,工件移动了,重新测量基准元素建立坐标系使用拟合坐标系法完成测量任务。

大家可以看二者的报告,实际数据只有细微的区别!


完整测量未移动:


DMISMN/'Created by [天永机械电子(上海)有限公司] on 星期五, 七月 29, 2016', 4.0

UNITS/MM, ANGDEC

WKPLAN/XYPLAN

PRCOMP/ON

TECOMP/ON

FLY/1.0

MODE/PROG, MAN

SNSET/APPRCH, 3.000000

SNSET/RETRCT, 1.000000

SNSET/DEPTH, 0.000000

SNSET/SEARCH, 10.000000

SNSET/CLRSRF, 10.000000

RECALL/D(MCS)

SNSLCT/S(20-30X2)

GEOALG/CIRCLE, LSTSQR

GEOALG/ARC, LSTSQR

GEOALG/PLANE, LSTSQR

$$

$$

MODE/MAN

F(PLN1) = FEAT/PLANE,CART, 534.0369, -907.8701, -807.3150, 0.000260,$

 0.000028, 1.000000

$$ Measurement points are created through actual points

MEAS/PLANE, F(PLN1), 4

  PTMEAS/CART,  386.975520, -772.131696, -807.280650,  0.000260, 0.000028,$

 1.000000

  PTMEAS/CART,  382.277757, -1008.558643, -807.272692,  0.000260, 0.000028,$

 1.000000

  PTMEAS/CART,  677.594002, -1009.195222, -807.349510,  0.000260, 0.000028,$

 1.000000

  PTMEAS/CART,  689.300137, -841.594746, -807.357331,  0.000260, 0.000028,$

 1.000000

ENDMES

F(CIR1) = FEAT/CIRCLE,INNER,CART, 419.5914, -792.5651, -813.3847, 0.000260,$

 0.000028, 1.000000, 30.0048

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR1), 4

  PTMEAS/CART,  404.607635, -791.818908, -813.380859,  0.998762, -0.049738,$

 -0.000258

  PTMEAS/CART,  411.432963, -779.975004, -813.382972,  0.543812, -0.839207,$

 -0.000118

  PTMEAS/CART,  433.657944, -787.349281, -813.388544,  -0.937618, -0.347666,$

 0.000254

  PTMEAS/CART,  421.894598, -807.389632, -813.384913,  -0.153519, 0.988146,$

 0.000012

ENDMES

F(PROJCI1) = FEAT/CIRCLE,INNER,CART, 419.5930, -792.5649, -807.2885,$

 0.000260, 0.000028, 1.000000, 30.0048

CONST/CIRCLE,F(PROJCI1),PROJCT,FA(CIR1),FA(PLN1)

F(CIR2) = FEAT/CIRCLE,INNER,CART, 639.3915, -802.4146, -812.4253, 0.000260,$

 0.000028, 1.000000, 30.0038

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR2), 4

  PTMEAS/CART,  624.422270, -803.404564, -812.421382,  0.997820, 0.065991,$

 -0.000261

  PTMEAS/CART,  637.710417, -787.507150, -812.425292,  0.112056, -0.993702,$

 -0.000001

  PTMEAS/CART,  654.306889, -800.806074, -812.429231,  -0.994235, -0.107219,$

 0.000262

  PTMEAS/CART,  641.707453, -817.236620, -812.425485,  -0.154379, 0.988012,$

 0.000012

ENDMES

F(PROJCI2) = FEAT/CIRCLE,INNER,CART, 639.3928, -802.4145, -807.3454,$

 0.000260, 0.000028, 1.000000, 30.0038

CONST/CIRCLE,F(PROJCI2),PROJCT,FA(CIR2),FA(PLN1)


$$ 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),(PROJCI1),(PROJCI2),(BFLN1), 0.000000, 0.000000,$

 1.000000

CONST/LINE,F(BFLN1),BF,FA(PROJCI1),FA(PROJCI2)

D(CRD1) = DATSET/FA(PLN1), ZDIR, ZORIG, FA(BFLN1), XDIR, FA(PROJCI1), XORIG

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

F(CIR3) = FEAT/CIRCLE,INNER,CART, 220.0189, -238.0111, -5.6843, 0.000000,$

 0.000000, 1.000000, 30.0144

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR3), 4

  PTMEAS/CART,  205.021789, -237.459881, -5.684280,  0.999325, -0.036733,$

 -0.000000

  PTMEAS/CART,  221.122937, -223.044596, -5.684280,  -0.073569, -0.997290,$

 0.000000

  PTMEAS/CART,  235.015229, -238.582120, -5.684280,  -0.999276, 0.038047,$

 0.000000

  PTMEAS/CART,  217.282684, -252.766815, -5.684280,  0.182325, 0.983238,$

 -0.000000

ENDMES

F(PROJCI3) = FEAT/CIRCLE,INNER,CART, 220.0189, -238.0111, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0144

CONST/CIRCLE,F(PROJCI3),PROJCT,FA(CIR3),FA(PLN1)

F(CIR4) = FEAT/CIRCLE,INNER,CART, 0.0225, -238.0205, -3.8199, 0.000000,$

 0.000000, 1.000000, 30.0203

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR4), 4

  PTMEAS/CART,  -14.987007, -237.880760, -3.819900,  0.999957, -0.009315,$

 -0.000000

  PTMEAS/CART,  -5.456899, -224.046285, -3.819900,  0.365046, -0.930990,$

 -0.000000

  PTMEAS/CART,  14.439835, -233.843862, -3.819900,  -0.960506, -0.278260,$

 0.000000

  PTMEAS/CART,  -1.892416, -252.908085, -3.819900,  0.127574, 0.991829,$

 -0.000000

ENDMES

F(PROJCI4) = FEAT/CIRCLE,INNER,CART, 0.0225, -238.0205, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0203

CONST/CIRCLE,F(PROJCI4),PROJCT,FA(CIR4),FA(PLN1)

F(CIR5) = FEAT/CIRCLE,INNER,CART, -54.9785, -239.0309, -3.8208, 0.000000,$

 0.000000, 1.000000, 30.0213

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR5), 4

  PTMEAS/CART,  -69.951124, -240.098490, -3.820824,  0.997467, 0.071126,$

 -0.000000

  PTMEAS/CART,  -55.348434, -224.024752, -3.820824,  0.024645, -0.999696,$

 0.000000

  PTMEAS/CART,  -40.132799, -236.811677, -3.820824,  -0.989011, -0.147839,$

 0.000000

  PTMEAS/CART,  -56.457230, -253.968467, -3.820824,  0.098512, 0.995136,$

 -0.000000

ENDMES

F(PROJCI5) = FEAT/CIRCLE,INNER,CART, -54.9785, -239.0309, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0213

CONST/CIRCLE,F(PROJCI5),PROJCT,FA(CIR5),FA(PLN1)

F(CIR6) = FEAT/CIRCLE,INNER,CART, 275.0247, -239.0274, -3.2752, 0.000000,$

 0.000000, 1.000000, 30.0370

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR6), 4

  PTMEAS/CART,  260.006782, -239.158545, -3.275208,  0.999962, 0.008736,$

 -0.000000

  PTMEAS/CART,  272.196316, -224.277599, -3.275208,  0.188326, -0.982107,$

 -0.000000

  PTMEAS/CART,  289.717881, -235.918514, -3.275208,  -0.978341, -0.207000,$

 0.000000

  PTMEAS/CART,  274.048245, -254.014051, -3.275208,  0.065016, 0.997884,$

 -0.000000

ENDMES

F(PROJCI6) = FEAT/CIRCLE,INNER,CART, 275.0247, -239.0274, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0370

CONST/CIRCLE,F(PROJCI6),PROJCT,FA(CIR6),FA(PLN1)

F(CIR7) = FEAT/CIRCLE,INNER,CART, 275.0240, 1.0233, -2.0508, 0.000000,$

 0.000000, 1.000000, 30.0334

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR7), 4

  PTMEAS/CART,  260.016794, 0.488534, -2.050846,  0.999366, 0.035608, -0.000000

  PTMEAS/CART,  272.757854, 15.867979, -2.050846,  0.150906, -0.988548, 0.000000

  PTMEAS/CART,  289.107752, 6.233654, -2.050846,  -0.937875, -0.346974, 0.000000

  PTMEAS/CART,  275.500922, -13.985872, -2.050846,  -0.031761, 0.999495,$

 -0.000000

ENDMES

F(PROJCI7) = FEAT/CIRCLE,INNER,CART, 275.0240, 1.0233, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0334

CONST/CIRCLE,F(PROJCI7),PROJCT,FA(CIR7),FA(PLN1)

F(CIR8) = FEAT/CIRCLE,INNER,CART, -54.9859, 1.0164, -3.0934, 0.000000,$

 0.000000, 1.000000, 30.0381

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR8), 4

  PTMEAS/CART,  -69.872952, -0.969644, -3.093401,  0.991218, 0.132240, -0.000000

  PTMEAS/CART,  -59.186244, 15.436180, -3.093401,  0.279674, -0.960095,$

 -0.000000

  PTMEAS/CART,  -40.349438, 4.385170, -3.093401,  -0.974521, -0.224295, 0.000000

  PTMEAS/CART,  -53.804271, -13.956019, -3.093401,  -0.078670, 0.996901,$

 -0.000000

ENDMES

F(PROJCI8) = FEAT/CIRCLE,INNER,CART, -54.9859, 1.0164, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0381

CONST/CIRCLE,F(PROJCI8),PROJCT,FA(CIR8),FA(PLN1)

F(PROJCI1) = FEAT/CIRCLE,INNER,CART, -0.0000, -0.0000, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0000

F(PROJCI2) = FEAT/CIRCLE,INNER,CART, 220.0000, -0.0000, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0000

F(PROJCI3) = FEAT/CIRCLE,INNER,CART, 220.0000, -238.0000, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0000

F(PROJCI4) = FEAT/CIRCLE,INNER,CART, -0.0000, -238.0000, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0000

F(PROJCI5) = FEAT/CIRCLE,INNER,CART, -55.0000, -239.0000, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0000

F(PROJCI6) = FEAT/CIRCLE,INNER,CART, 275.0000, -239.0000, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0000

F(PROJCI7) = FEAT/CIRCLE,INNER,CART, 275.0000, 1.0000, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0000

F(PROJCI8) = FEAT/CIRCLE,INNER,CART, -55.0000, 1.0000, 0.0000, 0.000000,$

 0.000000, 1.000000, 30.0000

T(TCORTOL3) = TOL/CORTOL,XAXIS, -0.0500, 0.0500

T(TCORTOL4) = TOL/CORTOL,YAXIS, -0.0500, 0.0500

T(TDIAM1) = TOL/DIAM, 0.0000, 0.0210

OUTPUT/FA(PROJCI1),TA(TCORTOL3),TA(TCORTOL4),TA(TDIAM1)

OUTPUT/FA(PROJCI2),TA(TCORTOL3),TA(TCORTOL4),TA(TDIAM1)

OUTPUT/FA(PROJCI3),TA(TCORTOL3),TA(TCORTOL4),TA(TDIAM1)

OUTPUT/FA(PROJCI4),TA(TCORTOL3),TA(TCORTOL4),TA(TDIAM1)

OUTPUT/FA(PROJCI5),TA(TCORTOL3),TA(TCORTOL4),TA(TDIAM1)

OUTPUT/FA(PROJCI6),TA(TCORTOL3),TA(TCORTOL4),TA(TDIAM1)

OUTPUT/FA(PROJCI7),TA(TCORTOL3),TA(TCORTOL4),TA(TDIAM1)

OUTPUT/FA(PROJCI8),TA(TCORTOL3),TA(TCORTOL4),TA(TDIAM1)

测量中间工件移动了:

DMISMN/'Created by [天永机械电子(上海)有限公司] on 星期五, 七月 29, 2016', 4.0

UNITS/MM, ANGDEC

WKPLAN/XYPLAN

PRCOMP/ON

TECOMP/ON

FLY/1.0

MODE/MAN

SNSET/APPRCH, 3.000000

SNSET/RETRCT, 1.000000

SNSET/DEPTH, 0.000000

SNSET/SEARCH, 10.000000

SNSET/CLRSRF, 10.000000

RECALL/D(MCS)

SNSLCT/S(20-30X2)

GEOALG/CIRCLE, LSTSQR

GEOALG/ARC, LSTSQR

GEOALG/PLANE, LSTSQR

MODE/MAN

$$

$$

F(PLN1) = FEAT/PLANE,CART, 495.6137, -884.0206, -807.3042, 0.000659,$

 0.000216, 1.000000

$$ Measurement points are created through actual points

MEAS/PLANE, F(PLN1), 4

  PTMEAS/CART,  358.183047, -785.130818, -807.234909,  0.000659, 0.000216,$

 1.000000

  PTMEAS/CART,  374.480930, -981.903708, -807.203164,  0.000659, 0.000216,$

 1.000000

  PTMEAS/CART,  624.892211, -972.501223, -807.370305,  0.000659, 0.000216,$

 1.000000

  PTMEAS/CART,  624.898693, -796.546821, -807.408304,  0.000659, 0.000216,$

 1.000000

ENDMES

F(CIR1) = FEAT/CIRCLE,INNER,CART, 424.3360, -766.1290, -812.5623, 0.000659,$

 0.000216, 1.000000, 30.0181

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR1), 4

  PTMEAS/CART,  409.372614, -764.959005, -812.552678,  0.996957, -0.077956,$

 -0.000641

  PTMEAS/CART,  419.143854, -752.046673, -812.561909,  0.345933, -0.938259,$

 -0.000025

  PTMEAS/CART,  438.605149, -761.474812, -812.572705,  -0.950705, -0.310095,$

 0.000694

  PTMEAS/CART,  424.905771, -781.127263, -812.559428,  -0.037963, 0.999279,$

 -0.000191

ENDMES

F(PROJCI1) = FEAT/CIRCLE,INNER,CART, 424.3395, -766.1279, -807.2827,$

 0.000659, 0.000216, 1.000000, 30.0181

CONST/CIRCLE,F(PROJCI1),PROJCT,FA(CIR1),FA(PLN1)

F(CIR2) = FEAT/CIRCLE,INNER,CART, 644.2630, -759.9752, -811.7911, 0.000659,$

 0.000216, 1.000000, 30.0037

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR2), 4

  PTMEAS/CART,  629.261661, -760.101060, -811.781144,  0.999965, 0.008386,$

 -0.000661

  PTMEAS/CART,  642.303011, -745.101976, -811.792982,  0.130649, -0.991429,$

 0.000128

  PTMEAS/CART,  658.661345, -755.763012, -811.801466,  -0.959772, -0.280781,$

 0.000693

  PTMEAS/CART,  646.474983, -774.813132, -811.789317,  -0.147448, 0.989070,$

 -0.000116

ENDMES

F(PROJCI2) = FEAT/CIRCLE,INNER,CART, 644.2659, -759.9743, -807.4290,$

 0.000659, 0.000216, 1.000000, 30.0037

CONST/CIRCLE,F(PROJCI2),PROJCT,FA(CIR2),FA(PLN1)


$$ 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),(PROJCI1),(PROJCI2),(BFLN1), 0.000000, 0.000000,$

 1.000000

CONST/LINE,F(BFLN1),BF,FA(PROJCI1),FA(PROJCI2)

D(CRD1) = DATSET/FA(PLN1), ZDIR, ZORIG, FA(BFLN1), XDIR, FA(PROJCI1), XORIG

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

F(CIR3) = FEAT/CIRCLE,INNER,CART, 220.0203, -238.0087, -7.5341, 0.000000,$

 0.000000, 1.000000, 29.9942

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR3), 4

  PTMEAS/CART,  219.847426, -223.012596, -7.534101,  0.011527, -0.999934,$

 0.000000

  PTMEAS/CART,  205.074468, -239.247757, -7.534101,  0.996581, 0.082619,$

 -0.000000

  PTMEAS/CART,  218.236954, -252.899401, -7.534101,  0.118913, 0.992905,$

 -0.000000

  PTMEAS/CART,  235.015958, -238.217131, -7.534101,  -0.999903, 0.013898,$

 0.000000

ENDMES

F(PROJCI3) = FEAT/CIRCLE,INNER,CART, 220.0203, -238.0087, -0.0000, 0.000000,$

 0.000000, 1.000000, 29.9942

CONST/CIRCLE,F(PROJCI3),PROJCT,FA(CIR3),FA(PLN1)

F(CIR4) = FEAT/CIRCLE,INNER,CART, 0.0181, -238.0247, -5.2863, 0.000000,$

 0.000000, 1.000000, 30.0045

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR4), 4

  PTMEAS/CART,  -14.969802, -238.679171, -5.286283,  0.999048, 0.043626,$

 -0.000000

  PTMEAS/CART,  -3.051876, -223.339915, -5.286283,  0.204639, -0.978838,$

 0.000000

  PTMEAS/CART,  14.697141, -234.927058, -5.286283,  -0.978451, -0.206477,$

 0.000000

  PTMEAS/CART,  -2.736979, -252.771776, -5.286283,  0.183649, 0.982992,$

 -0.000000

ENDMES

F(PROJCI4) = FEAT/CIRCLE,INNER,CART, 0.0181, -238.0247, -0.0000, 0.000000,$

 0.000000, 1.000000, 30.0045

CONST/CIRCLE,F(PROJCI4),PROJCT,FA(CIR4),FA(PLN1)

F(CIR5) = FEAT/CIRCLE,INNER,CART, -54.9762, -239.0245, -3.8747, 0.000000,$

 0.000000, 1.000000, 30.0298

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR5), 4

  PTMEAS/CART,  -69.751525, -241.695700, -3.874740,  0.984048, 0.177904,$

 -0.000000

  PTMEAS/CART,  -58.445007, -224.415795, -3.874740,  0.231027, -0.972947,$

 0.000000

  PTMEAS/CART,  -40.705783, -234.355103, -3.874740,  -0.950415, -0.310984,$

 0.000000

  PTMEAS/CART,  -53.315941, -253.947305, -3.874740,  -0.110572, 0.993868,$

 -0.000000

ENDMES

F(PROJCI5) = FEAT/CIRCLE,INNER,CART, -54.9762, -239.0245, -0.0000, 0.000000,$

 0.000000, 1.000000, 30.0298

CONST/CIRCLE,F(PROJCI5),PROJCT,FA(CIR5),FA(PLN1)

F(CIR6) = FEAT/CIRCLE,INNER,CART, 275.0320, -239.0157, -3.5133, 0.000000,$

 0.000000, 1.000000, 30.0482

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR6), 4

  PTMEAS/CART,  270.601293, -224.659791, -3.513344,  0.294906, -0.955526,$

 -0.000000

  PTMEAS/CART,  289.301036, -234.312718, -3.513344,  -0.949743, -0.313031,$

 0.000000

  PTMEAS/CART,  274.053815, -254.007970, -3.513344,  0.065107, 0.997878,$

 -0.000000

  PTMEAS/CART,  260.008532, -238.874918, -3.513344,  0.999956, -0.009372,$

 -0.000000

ENDMES

F(PROJCI6) = FEAT/CIRCLE,INNER,CART, 275.0320, -239.0157, -0.0000, 0.000000,$

 0.000000, 1.000000, 30.0482

CONST/CIRCLE,F(PROJCI6),PROJCT,FA(CIR6),FA(PLN1)

RECALL/D(MCS)

TEXT/OUTFIL, '工件移动了!!!'

F(PLN2) = FEAT/PLANE,CART, 521.1474, -831.7777, -807.3218, 0.000461,$

 0.000201, 1.000000

$$ Measurement points are created through actual points

MEAS/PLANE, F(PLN2), 4

  PTMEAS/CART,  379.885933, -740.664197, -807.275073,  0.000461, 0.000201,$

 1.000000

  PTMEAS/CART,  396.159321, -922.470467, -807.245936,  0.000461, 0.000201,$

 1.000000

  PTMEAS/CART,  654.271521, -913.541897, -807.366653,  0.000461, 0.000201,$

 1.000000

  PTMEAS/CART,  654.273009, -750.434097, -807.399520,  0.000461, 0.000201,$

 1.000000

ENDMES

F(CIR7) = FEAT/CIRCLE,INNER,CART, 412.3131, -719.7670, -811.6912, 0.000461,$

 0.000201, 1.000000, 29.9963

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR7), 4

  PTMEAS/CART,  397.320171, -720.162762, -811.684181,  0.999652, 0.026386,$

 -0.000466

  PTMEAS/CART,  407.283128, -705.637467, -811.691698,  0.335374, -0.942085,$

 0.000035

  PTMEAS/CART,  427.101125, -717.264999, -811.698485,  -0.985987, -0.166822,$

 0.000488

  PTMEAS/CART,  413.928069, -734.677999, -811.688907,  -0.107676, 0.994186,$

 -0.000151

ENDMES

F(PROJCI7) = FEAT/CIRCLE,INNER,CART, 412.3151, -719.7661, -807.2942,$

 0.000461, 0.000201, 1.000000, 29.9963

CONST/CIRCLE,F(PROJCI7),PROJCT,FA(CIR7),FA(PLN2)

F(CIR8) = FEAT/CIRCLE,INNER,CART, 632.0479, -708.7796, -812.6938, 0.000461,$

 0.000201, 1.000000, 29.9992

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR8), 4

  PTMEAS/CART,  617.111521, -710.155290, -812.686603,  0.995785, 0.091716,$

 -0.000477

  PTMEAS/CART,  623.194845, -696.671262, -812.692123,  0.590219, -0.807243,$

 -0.000109

  PTMEAS/CART,  646.566398, -705.011185, -812.701211,  -0.967926, -0.251233,$

 0.000497

  PTMEAS/CART,  634.117784, -723.635670, -812.691722,  -0.137996, 0.990433,$

 -0.000136

ENDMES

F(PROJCI8) = FEAT/CIRCLE,INNER,CART, 632.0503, -708.7785, -807.3977,$

 0.000461, 0.000201, 1.000000, 29.9992

CONST/CIRCLE,F(PROJCI8),PROJCT,FA(CIR8),FA(PLN2)

CALL/M(EASI_2PT_TO_LINE),(PROJCI7),(PROJCI8),(BFLN2), 0.000000, 0.000000,$

 1.000000

CONST/LINE,F(BFLN2),BF,FA(PROJCI7),FA(PROJCI8)

D(CRD2) = DATSET/FA(PLN2), ZDIR, ZORIG, FA(BFLN2), XDIR, FA(PROJCI7), XORIG

D(CRD2) = TRANS/ZORIG, -0, YORIG, FA(PROJCI7), XORIG, -0

EQUATE/DA(CRD1), DA(CRD2)

F(CIR9) = FEAT/CIRCLE,INNER,CART, -54.9939, 1.0150, -3.2300, 0.000000,$

 0.000000, 1.000000, 30.0359

$$ Measurement points are created through actual points

MEAS/CIRCLE, F(CIR9), 4

  PTMEAS/CART,  -54.454956, 16.023189, -3.229962,  -0.035887, -0.999356,$

 0.000000

  PTMEAS/CART,  -69.976085, 2.050620, -3.229962,  0.997619, -0.068964, -0.000000

  PTMEAS/CART,  -58.199321, -13.656944, -3.229962,  0.213439, 0.976956,$

 -0.000000

  PTMEAS/CART,  -40.389957, -2.486960, -3.229962,  -0.972434, 0.233180, 0.000000

ENDMES

F(PROJCI9) = FEAT/CIRCLE,INNER,CART, -54.9939, 1.0150, -0.0000, 0.000000,$

 0.000000, 1.000000, 30.0359

CONST/CIRCLE,F(PROJCI9),PROJCT,FA(CIR9),FA(PLN2)

F(PROJCI3) = FEAT/CIRCLE,INNER,CART, 220.000000, -238.000000, -0.000030,$

 0.000000, 0.000000, 1.000000, 30.000000

F(PROJCI4) = FEAT/CIRCLE,INNER,CART, 0.000000, -238.000000, -0.000030,$

 0.000000, 0.000000, 1.000000, 30.000000

F(PROJCI5) = FEAT/CIRCLE,INNER,CART, -55.000000, -239.000000, -0.000030,$

 0.000000, 0.000000, 1.000000, 30.000000

F(PROJCI6) = FEAT/CIRCLE,INNER,CART, 275.000000, -239.000000, -0.000030,$

 0.000000, 0.000000, 1.000000, 30.000000

F(PROJCI9) = FEAT/CIRCLE,INNER,CART, -55.000000, 1.000000, -0.000004,$

 0.000000, 0.000000, 1.000000, 30.000000



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