首页/文章/ 详情

PC DMIS RationalDMIS求最大(MX)最小(MN)函数

16小时前浏览5

对于PC DMIS软件可以使用“表达式构造器”,对于点集可以构造特征组,赋值,最大,最小函数,进行评价!这种对于数量较多的很方便,也可以使用IF语句循环找最大值,最小值!


或者使用数组函数和最大最小函数配合,这个对于数量较少点实用性更强。


零件名: 山涧果子

修订号: 

序列号: 

统计计数: 1

 

启动         =坐标系/开始,回调:使用_零件_设置,列表=是

            坐标系/终止

            模式/自动

            飞行/开

            格式/文本,选项, ,标题,符号, ;标称值,公差,测定值,偏差,超差, , 

            加载测头/LENOVO

            测尖/T1A0B0, 支撑方向 IJK=0, 0, 1, 角度=0

点1         =特征/触测/矢量点/默认,直角坐标

            理论值/<10.973,72.505,35>,<0,0,1>

            实际值/<10.973,72.505,35>,<0,0,1>

            目标值/<10.973,72.505,35>,<0,0,1>

            显示特征参数=否

            显示相关参数=是

              自动移动=否,距离=10

            显示触测=否

点2         =特征/触测/矢量点/默认,直角坐标

            理论值/<7.85,33.279,35>,<0,0,1>

            实际值/<7.85,33.279,35>,<0,0,1>

            目标值/<7.85,33.279,35>,<0,0,1>

            显示特征参数=否

            显示相关参数=是

              自动移动=否,距离=10

            显示触测=否

点3         =特征/触测/矢量点/默认,直角坐标

            理论值/<38.555,23.715,35>,<0,0,1>

            实际值/<38.555,23.715,35>,<0,0,1>

            目标值/<38.555,23.715,35>,<0,0,1>

            显示特征参数=否

            显示相关参数=是

              自动移动=否,距离=10

            显示触测=否

点4         =特征/触测/矢量点/默认,直角坐标

            理论值/<79.234,20.758,35>,<0,0,1>

            实际值/<79.234,20.758,35>,<0,0,1>

            目标值/<79.234,20.758,35>,<0,0,1>

            显示特征参数=否

            显示相关参数=是

              自动移动=否,距离=10

            显示触测=否

点5         =特征/触测/矢量点/默认,直角坐标

            理论值/<95.363,24.18,35>,<0,0,1>

            实际值/<95.363,24.18,35>,<0,0,1>

            目标值/<95.363,24.18,35>,<0,0,1>

            显示特征参数=否

            显示相关参数=是

              自动移动=否,距离=10

            显示触测=否

点6         =特征/触测/矢量点/默认,直角坐标

            理论值/<116.943,47.448,35>,<0,0,1>

            实际值/<116.943,47.448,35>,<0,0,1>

            目标值/<116.943,47.448,35>,<0,0,1>

            显示特征参数=否

            显示相关参数=是

              自动移动=否,距离=10

            显示触测=否

点7         =特征/触测/矢量点/默认,直角坐标

            理论值/<86.214,47.739,35>,<0,0,1>

            实际值/<86.214,47.739,35>,<0,0,1>

            目标值/<86.214,47.739,35>,<0,0,1>

            显示特征参数=否

            显示相关参数=是

              自动移动=否,距离=10

            显示触测=否

点8         =特征/触测/矢量点/默认,直角坐标

            理论值/<97.581,83.466,35>,<0,0,1>

            实际值/<97.581,83.466,35>,<0,0,1>

            目标值/<97.581,83.466,35>,<0,0,1>

            显示特征参数=否

            显示相关参数=是

              自动移动=否,距离=10

            显示触测=否

点9         =特征/触测/矢量点/默认,直角坐标

            理论值/<65.439,86.233,35>,<0,0,1>

            实际值/<65.439,86.233,34.98>,<0,0,1>

            目标值/<65.439,86.233,34.98>,<0,0,1>

            显示特征参数=否

            显示相关参数=是

              自动移动=否,距离=10

            显示触测=否

点10        =特征/触测/矢量点/默认,直角坐标

            理论值/<39.792,82.435,35>,<0,0,1>

            实际值/<39.792,82.435,35.03>,<0,0,1>

            目标值/<39.792,82.435,35.03>,<0,0,1>

            显示特征参数=否

            显示相关参数=是

              自动移动=否,距离=10

            显示触测=否

DIM 位置2= 点 的位置点1  单位=毫米 ,$

图示=关  文本=关  倍率=10.00  输出=两者  半角=否

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

Z       35.000      0.050     -0.050     35.000      0.000      0.000 ----#----

逼近矢量方向偏差        0.000      0.050     -0.050      0.000      0.000      0.000 ----#----

终止尺寸 位置2

DIM 位置3= 点 的位置点2  单位=毫米 ,$

图示=关  文本=关  倍率=10.00  输出=两者  半角=否

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

Z       35.000      0.050     -0.050     35.000      0.000      0.000 ----#----

逼近矢量方向偏差        0.000      0.050     -0.050      0.000      0.000      0.000 ----#----

终止尺寸 位置3

DIM 位置4= 点 的位置点3  单位=毫米 ,$

图示=关  文本=关  倍率=10.00  输出=两者  半角=否

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

Z       35.000      0.050     -0.050     35.000      0.000      0.000 ----#----

逼近矢量方向偏差        0.000      0.050     -0.050      0.000      0.000      0.000 ----#----

终止尺寸 位置4

DIM 位置5= 点 的位置点4  单位=毫米 ,$

图示=关  文本=关  倍率=10.00  输出=两者  半角=否

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

Z       35.000      0.050     -0.050     35.000      0.000      0.000 ----#----

逼近矢量方向偏差        0.000      0.050     -0.050      0.000      0.000      0.000 ----#----

终止尺寸 位置5

DIM 位置6= 点 的位置点5  单位=毫米 ,$

图示=关  文本=关  倍率=10.00  输出=两者  半角=否

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

Z       35.000      0.050     -0.050     35.000      0.000      0.000 ----#----

逼近矢量方向偏差        0.000      0.050     -0.050      0.000      0.000      0.000 ----#----

终止尺寸 位置6

DIM 位置7= 点 的位置点6  单位=毫米 ,$

图示=关  文本=关  倍率=10.00  输出=两者  半角=否

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

Z       35.000      0.050     -0.050     35.000      0.000      0.000 ----#----

逼近矢量方向偏差        0.000      0.050     -0.050      0.000      0.000      0.000 ----#----

终止尺寸 位置7

DIM 位置8= 点 的位置点7  单位=毫米 ,$

图示=关  文本=关  倍率=10.00  输出=两者  半角=否

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

Z       35.000      0.050     -0.050     35.000      0.000      0.000 ----#----

逼近矢量方向偏差        0.000      0.050     -0.050      0.000      0.000      0.000 ----#----

终止尺寸 位置8

DIM 位置9= 点 的位置点8  单位=毫米 ,$

图示=关  文本=关  倍率=10.00  输出=两者  半角=否

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

Z       35.000      0.050     -0.050     35.000      0.000      0.000 ----#----

逼近矢量方向偏差        0.000      0.050     -0.050      0.000      0.000      0.000 ----#----

终止尺寸 位置9

DIM 位置10= 点 的位置点9  单位=毫米 ,$

图示=关  文本=关  倍率=10.00  输出=两者  半角=否

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

Z       35.000      0.050     -0.050     34.980     -0.020      0.000 --#------

逼近矢量方向偏差        0.000      0.050     -0.050     -0.020     -0.020      0.000 --#------

终止尺寸 位置10

DIM 位置11= 点 的位置点10  单位=毫米 ,$

图示=关  文本=关  倍率=10.00  输出=两者  半角=否

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

Z       35.000      0.050     -0.050     35.030      0.030      0.000 -------#-

逼近矢量方向偏差        0.000      0.050     -0.050      0.030      0.030      0.000 -------#-

终止尺寸 位置11

扫描1        =特征/特征组,直角坐标

            理论值/<63.794,52.176,35>,<0,0,1>

            实际值/<63.794,52.176,35.001>,<0,0,1>

            构造/特征组,基本,点1,点2,点3,点4,点5,点6,点7,点8,点9,点10,,

            赋值/V1=MAX(扫描1.HIT[1..扫描1.NUMHITS].Z)

            赋值/V2=MIN(扫描1.HIT[1..扫描1.NUMHITS].Z)

            注释/报告,

            "最大值为:" + V1

            注释/报告,

            "最小值为:" + V2

DIM 位置1= 键入尺寸  输出=两者

AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL

M        0.000      0.010     -0.010      V1     35.030     35.020 -------->

            赋值/V3=MAX(ARRAY(点1.Z,点2.Z,点3.Z,点4.Z,点5.Z,点6.Z,点7.Z,点8.Z,点9.Z,点10.Z))

            赋值/V4=MIN(ARRAY(点1.Z,点2.Z,点3.Z,点4.Z,点5.Z,点6.Z,点7.Z,点8.Z,点9.Z,点10.Z))

            注释/报告,

            "点集数组中Z值最大为:"+V3

            注释/报告,

            "点集数组中Z值最小为:"+V4


对于RationalDMIS软件,可以使用DO循环,一维数组变量对数据进行存储,使用最大(MX)最小(MN)函数求最大最小值。



软件官方提供简便的方法如下:



变量数据区自带了 找到最大最小点轮廓/直径/半径/XYZ坐标 的内置宏,可以帮助用户取得这些信息;

操作方法是拖放式,例如:
想取得PT1~10中最大最小点轮廓是哪个可以多选中这些元素丢到MINMAX_PROFP标签上;



DMISMN/'Created by [山涧果子] on 星期二, 一月 23, 2018', 4.0

UNITS/MM, ANGDEC

WKPLAN/XYPLAN

PRCOMP/ON

TECOMP/ON

FLY/1.000000

MODE/PROG, MAN

SNSET/APPRCH, 1.000000

SNSET/RETRCT, 0.300000

SNSET/DEPTH, 2.000000

SNSET/SEARCH, 2.000000

SNSET/CLRSRF, 27.511591

RECALL/D(MCS)

SNSLCT/S(ROOTSN1)

GEOALG/CIRCLE, LSTSQR

GEOALG/ARC, LSTSQR

GEOALG/PLANE, LSTSQR

$$

$$

MODE/PROG,MAN

F(PT1) = FEAT/POINT,CART, 6.501193, 78.743019, 35.000000, 0.000000,$

0.000000, 1.000000

MEAS/POINT, F(PT1), 1

  PTMEAS/CART,  6.501193, 78.743019, 35.000000, 0.000000, 0.000000, 1.000000

ENDMES

F(PT2) = FEAT/POINT,CART, 6.088057, 35.401745, 35.000000, 0.000000,$

0.000000, 1.000000

MEAS/POINT, F(PT2), 1

  PTMEAS/CART,  6.088057, 35.401745, 35.000000, 0.000000, 0.000000, 1.000000

ENDMES

F(PT3) = FEAT/POINT,CART, 41.522984, 21.628914, 35.000000, 0.000000,$

0.000000, 1.000000

MEAS/POINT, F(PT3), 1

  PTMEAS/CART,  41.522984, 21.628914, 35.000000, 0.000000, 0.000000, 1.000000

ENDMES

F(PT4) = FEAT/POINT,CART, 70.678513, 20.076017, 35.000000, 0.000000,$

0.000000, 1.000000

MEAS/POINT, F(PT4), 1

  PTMEAS/CART,  70.678513, 20.076017, 35.000000, 0.000000, 0.000000, 1.000000

ENDMES

F(PT5) = FEAT/POINT,CART, 92.879288, 24.194994, 35.000000, 0.000000,$

0.000000, 1.000000

MEAS/POINT, F(PT5), 1

  PTMEAS/CART,  92.879288, 24.194994, 35.000000, 0.000000, 0.000000, 1.000000

ENDMES

F(PT6) = FEAT/POINT,CART, 114.658852, 44.793972, 35.000000, 0.000000,$

0.000000, 1.000000

MEAS/POINT, F(PT6), 1

  PTMEAS/CART,  114.658852, 44.793972, 35.000000, 0.000000, 0.000000, 1.000000

ENDMES

F(PT7) = FEAT/POINT,CART, 99.301079, 83.561592, 35.000000, 0.000000,$

0.000000, 1.000000

MEAS/POINT, F(PT7), 1

  PTMEAS/CART,  99.301079, 83.561592, 35.000000, 0.000000, 0.000000, 1.000000

ENDMES

F(PT8) = FEAT/POINT,CART, 38.599819, 83.308891, 35.000000, 0.000000,$

0.000000, 1.000000

MEAS/POINT, F(PT8), 1

  PTMEAS/CART,  38.599819, 83.308891, 35.000000, 0.000000, 0.000000, 1.000000

ENDMES

F(PT9) = FEAT/POINT,CART, 13.565872, 70.058662, 35.000000, 0.000000,$

0.000000, 1.000000

MEAS/POINT, F(PT9), 1

  PTMEAS/CART,  13.565872, 70.058662, 35.000000, 0.000000, 0.000000, 1.000000

ENDMES

F(PT10) = FEAT/POINT,CART, 16.010052, 41.680122, 35.000000, 0.000000,$

0.000000, 1.000000

MEAS/POINT, F(PT10), 1

  PTMEAS/CART,  16.010052, 41.680122, 35.000000, 0.000000, 0.000000, 1.000000

ENDMES

DECL/COMMON,INTGR,I

DECL/COMMON,REAL,PT_Z[10]

DECL/COMMON,DOUBLE,DMAX_Z

DECL/COMMON,DOUBLE,DMIN_Z

DECL/COMMON,CHAR,255,C1

DO/I,1,10,1

C1 = ASSIGN/CONCAT('PT',STR(I))

PT_Z[I] = OBTAIN/FA(@C1),5

ENDDO

DMAX_Z = ASSIGN/MX(PT_Z[1],PT_Z[2],PT_Z[3],PT_Z[4],PT_Z[5],PT_Z[6],PT_Z[7],PT_Z[8],PT_Z[9],PT_Z[10])

DMIN_Z = ASSIGN/MN(PT_Z[1],PT_Z[2],PT_Z[3],PT_Z[4],PT_Z[5],PT_Z[6],PT_Z[7],PT_Z[8],PT_Z[9],PT_Z[10])

WRITE/DID(DEFAULTSCREEN),'最大值为:',DMAX_Z

WRITE/DID(DEFAULTSCREEN),'最小值为:',DMIN_Z


$$

$$


$$ CREATED BY : External-Array Software, Inc

$$ DATE : July 7, 2004

$$ Last update: March 1, 2010

$$    Bug fix: change from CASE/'CPARLN': XINDEX = ASSIGN/4

$$     to CASE/'CPARLN': XINDEX = ASSIGN/5

$$ 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: DMIS OBTAIN/FA(Label), n

$$    Can be used to obtain feature's X, Y, Z value. However,

$$    the index position for n varies from feature to feature.

$$    For example, for feature of POINT, X index position is 3

$$ and for feature of CIRCLE, X index position is 4

$$

$$ This MACRO will return the X index position based on the feature Label

$$ NOTE: CALL must pass XINDEX with declared INTGR variable.

$$ RETURN: XINDEX = 0 if macro failed and non-zero indicates the X position

$$ Last update: 7-18-2010

$$ ARC index is 13 instead of 4


M(EASI_GETX_INDEX) = MACRO/'FEATLABEL', XINDEX

DECL/LOCAL, CHAR, 255, FNAME

XINDEX = ASSIGN/0

FNAME = OBTAIN/F(@FEATLABEL), 1

SELECT/FNAME

CASE/'POINT'

XINDEX = ASSIGN/3

ENDCAS

CASE/'EDGEPT'

XINDEX = ASSIGN/3

ENDCAS

CASE/'PLANE'

XINDEX = ASSIGN/3

ENDCAS

CASE/'GCURVE'

XINDEX = ASSIGN/3

ENDCAS

CASE/'LINE'

XINDEX = ASSIGN/4

ENDCAS

CASE/'CIRCLE'

XINDEX = ASSIGN/4

ENDCAS

CASE/'ARC'

XINDEX = ASSIGN/13

ENDCAS

CASE/'ELLIPS'

XINDEX = ASSIGN/4

ENDCAS

CASE/'SPHERE'

XINDEX = ASSIGN/4

ENDCAS

CASE/'CYLNDR'

XINDEX = ASSIGN/4

ENDCAS

CASE/'CONE'

XINDEX = ASSIGN/4

ENDCAS

CASE/'CPARLN'

XINDEX = ASSIGN/5

ENDCAS

DFTCAS

ENDCAS

ENDSEL

ENDMAC



$$ CREATED BY : External-Array Software, Inc

$$ DATE : Oct 1, 2010

$$ Last update: 2010-12-13

$$ Two features CALL will not get correct MIN/MAX

$$ 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: FEATLABEL is a Point Reducible feature Label.

$$    MINLABEL MUST be a declared CHAR variable

$$    MAXLABEL MUST be a declared CHAR variable

$$ DMIN MUST be a decleared DOUBLE/REAL variable

$$ DMAX MUST be a decleared DOUBLE/REAL variable

$$

$$ The function of this MACRO is to find the Min/Max of Z Coordinate from

$$ the repeated CALL/M(). The MINLABEL stores the feature with Min

$$  Z Coordinate and the MAXLABEL stores the feature with Max Z Coordinate.

$$ The Min and Max Z Coordinate are stored in DMIN and DMAX respectively.

$$

$$  Important note: before the first macro call, variable MINLABEL

$$  and MAXLABEL MUST be assigned to empty. Otherwise, this macro will not work

$$ Also, the DMIN needs to be initialized with a larger number than all the

$$ possible feature Z Coordinate. The DMAX needs to be initialized with a 

$$  smaller number than all the possible feature Z Coordinate.

$$

$$ The MACRO calls M(EASI_GETX_INDEX) that must be previously defined.

$$  M(EASI_GETX_INDEX) is internal MACRO as well


M(EASI_MINMAX_ZCOORD) = MACRO/'FEATLABEL', 'MINLABEL', 'MAXLABEL', DMIN, DMAX

DECL/LOCAL,DOUBLE, VRF

DECL/LOCAL,INTGR, XINDEX

CALL/M(EASI_GETX_INDEX), (FEATLABEL), XINDEX

VRF = OBTAIN/FA(@FEATLABEL), (XINDEX+2)

if/(LEN(MINLABEL) .EQ. 0 )

MINLABEL = ASSIGN/FEATLABEL

DMIN = ASSIGN/VRF

else

if/(VRF .LT. DMIN)

MINLABEL = ASSIGN/FEATLABEL

DMIN = ASSIGN/VRF

endif

endif

if/(LEN(MAXLABEL) .EQ. 0 )

MAXLABEL = ASSIGN/FEATLABEL

DMAX = ASSIGN/VRF

else

if/(VRF .GT. DMAX)

MAXLABEL = ASSIGN/FEATLABEL

DMAX = ASSIGN/VRF

endif

endif

ENDMAC



KNPTR1 = ASSIGN/100000

KNPTR2 = ASSIGN/(-KNPTR1)

KNPTC1 = ASSIGN/''

KNPTC2 = ASSIGN/''

CALL/M(EASI_MINMAX_ZCOORD), (PT1), (KNPTC1), (KNPTC2), (KNPTR1), (KNPTR2)

CALL/M(EASI_MINMAX_ZCOORD), (PT2), (KNPTC1), (KNPTC2), (KNPTR1), (KNPTR2)

CALL/M(EASI_MINMAX_ZCOORD), (PT3), (KNPTC1), (KNPTC2), (KNPTR1), (KNPTR2)

CALL/M(EASI_MINMAX_ZCOORD), (PT4), (KNPTC1), (KNPTC2), (KNPTR1), (KNPTR2)

CALL/M(EASI_MINMAX_ZCOORD), (PT5), (KNPTC1), (KNPTC2), (KNPTR1), (KNPTR2)

CALL/M(EASI_MINMAX_ZCOORD), (PT6), (KNPTC1), (KNPTC2), (KNPTR1), (KNPTR2)

CALL/M(EASI_MINMAX_ZCOORD), (PT7), (KNPTC1), (KNPTC2), (KNPTR1), (KNPTR2)

CALL/M(EASI_MINMAX_ZCOORD), (PT8), (KNPTC1), (KNPTC2), (KNPTR1), (KNPTR2)

CALL/M(EASI_MINMAX_ZCOORD), (PT9), (KNPTC1), (KNPTC2), (KNPTR1), (KNPTR2)

CALL/M(EASI_MINMAX_ZCOORD), (PT10), (KNPTC1), (KNPTC2), (KNPTR1), (KNPTR2)

$$

$$

WRITE/DID(DEFAULTSCREEN),'Min Z Coord = ', KNPTR1, ' of feature (',KNPTC1, ')'

WRITE/DID(DEFAULTSCREEN),'Max Z Coord = ', KNPTR2, ' of feature (',KNPTC2, ')'

    更多具体的操作,请参考海克斯康(PC DMIS)软件帮助文件,以及爱科腾瑞(RationalDMIS)软件帮助文件。

来源:山涧果子
MarcUGUM理论
著作权归作者所有,欢迎分享,未经许可,不得转载
首次发布时间:2024-12-27
最近编辑:16小时前
山涧果子
大专 签名征集中
获赞 204粉丝 51文章 176课程 0
点赞
收藏
作者推荐

RationalDMIS最佳拟合坐标系

最佳拟合法和3最佳拟合法拟合坐标系: 这种方法适用于零件有特征可以测量或构造,零件的评价方法要在原始数模坐标系下,或数模坐标系比较复杂,直接用3-2-1法拟合难度大。 由于零件本身是存在有制造误差的,在实际拟合过程中这些误差是平均分配在每一个元素的坐标拟合中,所以这些元素在与数模拟合过程中的误差是平均分配的。所以拟合后会发现这些参与拟合的元素实测值与理论值都有偏差,这是正常的。最佳拟合法一般会平分这些误差,常规3-2-1法操作如下: 由于坐标系原点不在两个圆孔的任何一个,两点偏移队列坐标系一般误差计算结果在第二元素的单个方向,可以从第二元素的下拉框里面选择方向,指定方向的参数会包括所有误差,第一第二元素的另外三个坐标会没有误差;这个和实际不多相符,常规方法需要两孔连线,两孔中分点为坐标系原点,旋转角度,平移!DMISMN/&#39;Created by [山涧果子] on 星期四, 三月 15, 2018&#39;, 4.0UNITS/MM, ANGDECWKPLAN/XYPLANPRCOMP/ONTECOMP/ONFLY/1.0MODE/PROG, MANSNSET/APPRCH, 3.000000SNSET/RETRCT, 3.000000SNSET/DEPTH, 0.000000SNSET/SEARCH, 10.000000SNSET/CLRSRF, 50.000000RECALL/D(MCS)SNSLCT/S(20-30X2)GEOALG/CIRCLE, LSTSQRGEOALG/ARC, LSTSQRGEOALG/PLANE, LSTSQR$$$$MODE/MANF(PLN1) = FEAT/PLANE,CART, 486.0224, -642.3089, -625.3113, -0.000189,$0.000549, 1.000000$$ Measurement points are created through actual pointsMEAS/PLANE, F(PLN1), 4 PTMEAS/CART, 638.799166, -742.685150, -625.227220, -0.000189, 0.000549,$1.000000 PTMEAS/CART, 567.211586, -592.458027, -625.323311, -0.000189, 0.000549,$1.000000 PTMEAS/CART, 429.261550, -559.235412, -625.367682, -0.000189, 0.000549,$1.000000 PTMEAS/CART, 308.817401, -674.856913, -625.326961, -0.000189, 0.000549,$1.000000ENDMESD(CRD1) = DATSET/FA(PLN1), ZDIRD(CRD1) = TRANS/ZORIG, FA(PLN1)WKPLAN/XYPLANF(CIR1) = FEAT/CIRCLE,OUTER,CART, 331.4403, -606.3965, 2.8957, -0.000000,$0.000000, 1.000000, 18.3865$$ Measurement points are created through actual pointsMEAS/CIRCLE, F(CIR1), 4 PTMEAS/CART, 340.561970, -605.251761, 2.895749, 0.992217, 0.124517, 0.000000 PTMEAS/CART, 330.257044, -597.279694, 2.895749, -0.128706, 0.991683,$0.000000 PTMEAS/CART, 322.384588, -604.812029, 2.895749, -0.985036, 0.172350,$0.000000 PTMEAS/CART, 330.368842, -615.527082, 2.895749, -0.116545, -0.993185,$0.000000ENDMESF(CIR2) = FEAT/CIRCLE,OUTER,CART, 621.1683, -762.5868, 2.0847, -0.000000,$0.000000, 1.000000, 14.8570$$ Measurement points are created through actual pointsMEAS/CIRCLE, F(CIR2), 4 PTMEAS/CART, 620.597379, -769.993280, 2.084635, -0.076855, -0.997042,$0.000000 PTMEAS/CART, 619.163963, -769.739741, 2.084635, -0.269817, -0.962912,$0.000000 PTMEAS/CART, 621.989434, -755.203817, 2.084635, 0.110540, 0.993872, 0.000000 PTMEAS/CART, 623.369025, -755.491769, 2.084635, 0.296256, 0.955108, 0.000000ENDMESF(PROJPT1) = FEAT/POINT,CART, 331.4403, -606.3965, -0.0000, -0.000000,$-0.000000, 1.000000CONST/POINT,F(PROJPT1),PROJPT,FA(CIR1),FA(PLN1)F(PROJPT2) = FEAT/POINT,CART, 621.1683, -762.5868, -0.0000, 0.000000,$0.000000, 1.000000CONST/POINT,F(PROJPT2),PROJPT,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&#39;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 onM(EASI_2PT_TO_LINE) = Macro/&#39;FEAT1&#39;, &#39;FEAT2&#39;, &#39;FEATLINE&#39;, DI, DJ, DKDECL/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),INDEX1DVALUE[2] = OBTAIN/FA(@FEAT1),INDEX1+1DVALUE[3] = OBTAIN/FA(@FEAT1),INDEX1+2 DVALUE[4] = OBTAIN/FA(@FEAT2),INDEX2DVALUE[5] = OBTAIN/FA(@FEAT2),INDEX2+1DVALUE[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, DKENDMACCALL/M(EASI_2PT_TO_LINE),(PROJPT1),(PROJPT2),(BFLN1), 0.000189, -0.000549,$1.000000CONST/LINE,F(BFLN1),BF,FA(PROJPT1),FA(PROJPT2)F(MIDPT1) = FEAT/POINT,CART, 476.3043, -684.4917, -0.0000, 0.000189,$-0.000549, 1.000000CONST/POINT, F(MIDPT1), MIDPT, FA(PROJPT1), FA(PROJPT2)D(CRD2) = DATSET/FA(PLN1), ZDIR, ZORIG, FA(BFLN1), XDIR, FA(MIDPT1), XORIGD(CRD2) = TRANS/ZORIG, -0, YORIG, FA(MIDPT1), XORIG, -0D(CRD3) = ROTATE/ZAXIS, RTOD(ATAN2(119.9+35,140.5+150))D(CRD4) = TRANS/XORIG, -(140.5+150)/2, YORIG, (119.9+35)/2D(CRD5) = TRANS/XORIG, 140.5, YORIG, -119.9$$TEXT/OPER, &#39;请将测头移动到安全位置,DCC测量开始!!&#39;$$MODE/PROG,MAN$$ 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, TARZDECL/LOCAL, REAL, CCX, CCY, CCZ, CCI, CCJ, CCKDECL/LOCAL, REAL, CURX, CURY, CURZ, TD, CLRDIST, SDIAMDECL/LOCAL, CHAR, 255, CLRLABEL, FLABEL, MMODE, SNAMEMMODE = VALUE/MODECLRLABEL = VALUE/SNSET, CLRSRFIF/ ( (LEN(CLRLABEL) .GT. 0) .AND. (MMODE .EQ. &#39;PROG,MAN&#39;) )CLRDIST = VALUE/SNSET, CLRSRF, DISTFLABEL = ASSIGN/&#39;FA&#39;IF/ ISNOM .EQ. 0FLABEL = ASSIGN/&#39;F&#39;ENDIFCCX = OBTAIN/FLABEL(@CLRLABEL), 3CCY = OBTAIN/FLABEL(@CLRLABEL), 4CCZ = OBTAIN/FLABEL(@CLRLABEL), 5CCI = OBTAIN/FLABEL(@CLRLABEL), 6CCJ = OBTAIN/FLABEL(@CLRLABEL), 7CCK = OBTAIN/FLABEL(@CLRLABEL), 8SNAME = VALUE/SNSLCTSDIAM = OBTAIN/SS(SNAME), 8CCX = ASSIGN/CCX + CCI * SDIAM/2CCY = ASSIGN/CCY + CCJ * SDIAM/2CCZ = ASSIGN/CCZ + CCK * SDIAM/2CURX = VALUE/GOTO, XAXISCURY = VALUE/GOTO, YAXISCURZ = VALUE/GOTO, ZAXISTD = ASSIGN/(CURX - CCX) * CCI + (CURY - CCY) * CCJ + (CURZ - CCZ) * CCKIF/ TD .LT. CLRDISTTD = ASSIGN/(CLRDIST - TD)GOTO/CURX+CCI*TD, CURY+CCJ*TD, CURZ+CCK*TDENDIFTD = ASSIGN/(TARX - CCX) * CCI + (TARY - CCY) * CCJ + (TARZ - CCZ) * CCKIF/ TD .LT. CLRDISTTD = ASSIGN/(CLRDIST - TD)GOTO/TARX+CCI*TD, TARY+CCJ*TD, TARZ+CCK*TDENDIFENDIFENDMACSNSET/APPRCH, 3.0000SNSET/RETRCT, 3.0000SNSET/DEPTH, 0.0000SNSET/SEARCH, 10.0000SNSET/CLRSRF, 50.0000GOTO/52.281195, 52.781717, 180.296564GOTO/-140.542113, 30.928417, 60.122964F(PLN2) = FEAT/PLANE,CART, 26.5108, 76.9185, 0.0005, -0.000013, -0.000055,$1.000000$$ Measurement points are created through actual pointsMEAS/PLANE, F(PLN2), 4 PTMEAS/CART, -162.140109, 50.907571, -0.003525, -0.000013, -0.000055,$1.000000 GOTO/CART, -162.127170, 50.871843, 56.515012 GOTO/CART, -15.336534, 161.474131, 56.546023 PTMEAS/CART, -17.823063, 165.565714, 0.004738, -0.000013, -0.000055,$1.000000 GOTO/CART, -17.816652, 165.546735, 31.656004 GOTO/CART, 118.131993, 103.794164, 31.590550 PTMEAS/CART, 117.664092, 103.810998, 0.003141, -0.000013, -0.000055,$1.000000 GOTO/CART, 117.673443, 103.792854, 33.509655 GOTO/CART, 167.877916, -12.339184, 33.434820 PTMEAS/CART, 168.342415, -12.609932, -0.002611, -0.000013, -0.000055,$1.000000 GOTO/CART, 168.377198, -12.696555, 138.458991 GOTO/CART, -136.195883, 118.859236, 138.596584ENDMESGOTO/-140.500000, 119.900000, 150.000000F(CIR3) = FEAT/CIRCLE,OUTER,CART, -140.5000, 119.9000, 2.8000, 0.000000,$0.000000, 1.000000, 18.4000$$ Measurement points are created through nominal pointsMEAS/CIRCLE, F(CIR3), 4 GOTO/CART, -127.615068, 122.732841, 53.792667 GOTO/CART, -127.615068, 122.732841, 52.800000 PTMEAS/CART, -131.514601, 121.875502, 2.800000, 0.976681, 0.214696,$-0.000000 GOTO/CART, -127.511793, 117.586354, 2.800000 GOTO/CART, -129.385856, 112.792098, 2.800000 GOTO/CART, -132.951946, 109.079956, 2.800000 PTMEAS/CART, -138.524498, 110.914601, 2.800000, 0.214696, -0.976681,$-0.000000 GOTO/CART, -142.813646, 106.911793, 2.800000 GOTO/CART, -147.607902, 108.785856, 2.800000 GOTO/CART, -151.320044, 112.351946, 2.800000 PTMEAS/CART, -149.485399, 117.924498, 2.800000, -0.976681, -0.214696,$0.000000 GOTO/CART, -153.488207, 122.213646, 2.800000 GOTO/CART, -151.614144, 127.007902, 2.800000 GOTO/CART, -148.048054, 130.720044, 2.800000 PTMEAS/CART, -142.475502, 128.885399, 2.800000, -0.214696, 0.976681,$0.000000 GOTO/CART, -143.332841, 132.784932, 52.800000ENDMESGOTO/150.000000, -35.000000, 150.000000GOTO/156.436269, -17.252947, 9.635601F(CIR4) = FEAT/CIRCLE,OUTER,CART, 150, -35, 2.4339, 0.000000,$0.000000, 1.000000, 14.9$$ Measurement points are created through actual pointsMEAS/CIRCLE, F(CIR4), 4 PTMEAS/CART, 151.645854, -27.759575, 2.433926, 0.226903, 0.973917, 0.000000 PTMEAS/CART, 150.454534, -27.582380, 2.433926, 0.066366, 0.997795, 0.000000 GOTO/CART, 142.957924, -21.486019, 2.442799 GOTO/CART, 133.999321, -33.143763, 2.437123 GOTO/CART, 135.953164, -43.287164, 2.431184 GOTO/CART, 145.178435, -45.801646, 2.428035 PTMEAS/CART, 148.307722, -42.220885, 2.433926, -0.222931, -0.974834,$0.000000 PTMEAS/CART, 149.402427, -42.386504, 2.433926, -0.075412, -0.997152,$0.000000 GOTO/CART, 149.347831, -49.365732, 2.425780 GOTO/CART, 149.376228, -49.456664, 108.899701 GOTO/CART, 149.374722, -49.455172, 108.901202ENDMESF(PROJPT3) = FEAT/POINT,CART, -140.5000, 119.9002, 0.0006, -0.000013,$-0.000055, 1.000000CONST/POINT,F(PROJPT3),PROJPT,FA(CIR3),FA(PLN2)F(PROJPT4) = FEAT/POINT,CART, 150.0000, -34.9999, -0.0041, -0.000013,$-0.000055, 1.000000CONST/POINT,F(PROJPT4),PROJPT,FA(CIR4),FA(PLN2)CALL/M(EASI_2PT_TO_LINE),(PROJPT3),(PROJPT4),(BFLN2), 0.000192, -0.000549,$1.000000CONST/LINE,F(BFLN2),BF,FA(PROJPT3),FA(PROJPT4)F(MIDPT2) = FEAT/POINT,CART, 4.7500, 42.4501, -0.0017, 0.000192, -0.000549,$1.000000CONST/POINT, F(MIDPT2), MIDPT, FA(PROJPT3), FA(PROJPT4)D(CRD6) = DATSET/FA(PLN2), ZDIR, ZORIG, FA(BFLN2), XDIR, FA(MIDPT2), XORIGD(CRD6) = TRANS/ZORIG, -0, YORIG, FA(MIDPT2), XORIG, -0D(CRD7) = ROTATE/ZAXIS, RTOD(ATAN2(119.9+35,140.5+150))D(CRD8) = TRANS/XORIG, -(140.5+150)/2, YORIG, (119.9+35)/2D(CRD9) = TRANS/XORIG, 140.5, YORIG, -119.9RECALL/D(CRD9)MODE/PROG,MANGOTO/-140.500000, 119.900000, 150.000000F(J-1) = FEAT/CIRCLE,OUTER,CART, -140.5000, 119.9000, 2.8000, -0.000000,$-0.000000, 1.000000, 18.4000$$ Measurement points are created through nominal pointsMEAS/CIRCLE, F(J-1), 4 GOTO/CART, -128.329960, 124.992799, 53.792667 GOTO/CART, -128.329960, 124.992799, 52.800000 PTMEAS/CART, -132.013136, 123.451499, 2.800000, 0.922499, 0.386000,$-0.000000 GOTO/CART, -127.307420, 119.947860, 2.800000 GOTO/CART, -128.293330, 114.895635, 2.800000 GOTO/CART, -131.137595, 110.605279, 2.800000 PTMEAS/CART, -136.948501, 111.413136, 2.800000, 0.386000, -0.922499,$0.000000 GOTO/CART, -140.452140, 106.707420, 2.800000 GOTO/CART, -145.504365, 107.693330, 2.800000 GOTO/CART, -149.794721, 110.537595, 2.800000 PTMEAS/CART, -148.986864, 116.348501, 2.800000, -0.922499, -0.386000,$0.000000 GOTO/CART, -153.692580, 119.852140, 2.800000 GOTO/CART, -152.706670, 124.904365, 2.800000 GOTO/CART, -149.862405, 129.194721, 2.800000 PTMEAS/CART, -144.051499, 128.386864, 2.800000, -0.386000, 0.922499,$-0.000000 GOTO/CART, -145.592799, 132.070040, 52.800000ENDMESGOTO/-140.500000, 119.900000, 150.000000GOTO/150.000000, -35.000000, 150.000000GOTO/154.826612, -16.147063, 8.730493F(J-2) = FEAT/CIRCLE,OUTER,CART, 150, -35, 2.2195, -0.000000,$-0.000000, 1.000000, 14.8541$$ Measurement points are created through actual pointsMEAS/CIRCLE, F(J-2), 4 PTMEAS/CART, 152.027880, -27.844046, 2.219498, 0.277537, 0.960715, 0.000000 PTMEAS/CART, 150.592037, -27.578655, 2.219498, 0.084211, 0.996448, 0.000000 GOTO/CART, 144.281290, -23.599383, 2.225922 GOTO/CART, 137.560233, -23.634701, 2.225784 GOTO/CART, 137.677814, -46.663385, 2.214399 GOTO/CART, 147.998456, -46.621060, 2.212302 PTMEAS/CART, 147.966814, -42.132080, 2.219498, -0.269257, -0.963068,$0.000000 PTMEAS/CART, 149.522122, -42.393062, 2.219498, -0.059846, -0.998208,$0.000000 GOTO/CART, 148.776049, -48.817064, 2.212059 GOTO/CART, 148.817950, -53.735968, 128.112775ENDMESGOTO/150, -35, 150.000000GOTO/-82.000000, 157.000000, 150.000000F(J-3) = FEAT/CIRCLE,INNER,CART, -82.0000, 157.0000, -1.3000, -0.000000,$-0.000000, 1.000000, 15.0000$$ Measurement points are created through nominal pointsMEAS/CIRCLE, F(J-3), 4 GOTO/CART, -78.497078, 156.824166, 49.692667 GOTO/CART, -78.497078, 156.824166, 48.700000 PTMEAS/CART, -74.509431, 156.624000, -1.300000, -0.998744, 0.050102,$0.000000 GOTO/CART, -78.831011, 155.497040, -1.300000 GOTO/CART, -79.647393, 154.398726, -1.300000 GOTO/CART, -80.821939, 153.696433, -1.300000 PTMEAS/CART, -82.376000, 149.509431, -1.300000, 0.050102, 0.998744,$-0.000000 GOTO/CART, -83.502960, 153.831011, -1.300000 GOTO/CART, -84.601274, 154.647393, -1.300000 GOTO/CART, -85.303567, 155.821939, -1.300000 PTMEAS/CART, -89.490569, 157.376000, -1.300000, 0.998744, -0.050102,$-0.000000 GOTO/CART, -85.168989, 158.502960, -1.300000 GOTO/CART, -84.352607, 159.601274, -1.300000 GOTO/CART, -83.178061, 160.303567, -1.300000 PTMEAS/CART, -81.624000, 164.490569, -1.300000, -0.050102, -0.998744,$0.000000 GOTO/CART, -81.824166, 160.502922, 48.700000ENDMESGOTO/175.200000, 32.600000, 150.000000F(J-4) = FEAT/CIRCLE,INNER,CART, 175.2000, 32.6000, -1.3500, -0.000000,$-0.000000, 1.000000, 18.4000$$ Measurement points are created through nominal pointsMEAS/CIRCLE, F(J-4), 4 GOTO/CART, 180.347235, 31.811146, 49.642667 GOTO/CART, 180.347235, 31.811146, 48.650000 PTMEAS/CART, 184.293822, 31.206301, -1.350000, -0.988458, 0.151494, 0.000000 GOTO/CART, 179.653543, 29.901433, -1.350000 GOTO/CART, 178.281841, 28.402552, -1.350000 GOTO/CART, 176.440955, 27.542694, -1.350000 PTMEAS/CART, 173.806301, 23.506178, -1.350000, 0.151494, 0.988458, -0.000000 GOTO/CART, 172.501433, 28.146457, -1.350000 GOTO/CART, 171.002552, 29.518159, -1.350000 GOTO/CART, 170.142694, 31.359045, -1.350000 PTMEAS/CART, 166.106178, 33.993699, -1.350000, 0.988458, -0.151494,$-0.000000 GOTO/CART, 170.746457, 35.298567, -1.350000 GOTO/CART, 172.118159, 36.797448, -1.350000 GOTO/CART, 173.959045, 37.657306, -1.350000 PTMEAS/CART, 176.593699, 41.693822, -1.350000, -0.151494, -0.988458,$0.000000 GOTO/CART, 175.988854, 37.747235, 48.650000ENDMESGOTO/23.354863, 52.163612, 223.054633T(TCORTOL1) = TOL/CORTOL,XAXIS, -0.0300, 0.0300T(TCORTOL2) = TOL/CORTOL,YAXIS, -0.0300, 0.0300OUTPUT/FA(J-1),TA(TCORTOL1),TA(TCORTOL2)OUTPUT/FA(J-2),TA(TCORTOL1),TA(TCORTOL2)OUTPUT/FA(J-3),TA(TCORTOL1),TA(TCORTOL2)OUTPUT/FA(J-4),TA(TCORTOL1),TA(TCORTOL2)来源:山涧果子

未登录
还没有评论
课程
培训
服务
行家
VIP会员 学习计划 福利任务
下载APP
联系我们
帮助与反馈