首页/文章/ 详情

RationalDMIS程序循环中的ID实例

1天前浏览4

  在程序中使用循环时,将元素或特征ID借助循环索引定义成变量会非常有用。 这样的话可以避免循环在同一次测量中重复运行时,元素或特征被覆盖。

 

应用情况1 – 用一个程序循环定义

测量中需要将一个元素的ID定义成变量,因为这个元素举例来说会通过一个程序循环多次被测量。

 
在程序中有一个包含循环索引i的循环(这样才能在表达式中将变量用于循环索引)。


DMISMN/'Created by [山涧果子] on 星期五, 三月 31, 2017', 4.0

UNITS/MM, ANGDEC

WKPLAN/XYPLAN

PRCOMP/ON

TECOMP/ON

FLY/1.000000

MODE/PROG, MAN

SNSET/APPRCH, 2.000000

SNSET/RETRCT, 2.000000

SNSET/DEPTH, 0.000000

SNSET/SEARCH, 10.000000

SNSET/CLRSRF, 10.000000

RECALL/D(MCS)

SNSLCT/S(ROOTSN1)

GEOALG/CIRCLE, LSTSQR

GEOALG/ARC, LSTSQR

GEOALG/PLANE, LSTSQR

$$

$$

MODE/PROG,MAN

DECL/COMMON,INTGR,I

DECL/COMMON,CHAR,255,C1

DO/I,1,10,1

C1 = ASSIGN/CONCAT('J','-',STR(I))

F(@C1) = FEAT/CIRCLE,INNER,CART, 30.000000, 30.000002, -0.000001,$

 -0.000000, -0.000000, 1.000000, 19.999999

$$ Measurement points are created through nominal points

MEAS/CIRCLE, F(@C1), 4

  PTMEAS/CART,  38.054972, 24.074007, -0.000001, -0.805497, 0.592600, 0.000000

  GOTO/CART,  36.796722, 28.325321, -0.000001

  GOTO/CART,  36.920225, 31.053792, -0.000001

  GOTO/CART,  35.990186, 33.621833, -0.000000

  PTMEAS/CART,  35.925995, 38.054974, -0.000000, -0.592600, -0.805497, -0.000000

  GOTO/CART,  31.674680, 36.796725, -0.000000

  GOTO/CART,  28.946210, 36.920228, -0.000000

  GOTO/CART,  26.378169, 35.990189, -0.000000

  PTMEAS/CART,  21.945028, 35.925997, -0.000000, 0.805497, -0.592600, -0.000000

  GOTO/CART,  23.203277, 31.674683, -0.000001

  GOTO/CART,  23.079774, 28.946212, -0.000001

  GOTO/CART,  24.009813, 26.378171, -0.000001

  PTMEAS/CART,  24.074005, 21.945030, -0.000001, 0.592600, 0.805497, 0.000000

ENDMES


ENDDO

应用情况2 – 用两个程序循环定义

测量中需要将一个元素的ID定义成变量,因为这个元素举例来说会通过两个程序循环多次被测量(举例来说要测量一个阵列孔板)。

在程序中至少有两个循环(包含循环索引I和J)。


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

RationalDMIS相对参照平面测量

测量钣金零件的过程中,频繁的弹跳可能导致故障。在执行正确编程的程序时,并未在金属板二分之一厚度处精确测量边界点、圆、矩形和槽等元素。在一些极端情况下,测量点可能丢失或发生冲突。相对参照平面测量这些元素可以解决这一问题。 相对参照平面,在测量时定义了测头半径补偿方向DMISMN/'Created by [爱科腾瑞(CNC).12.9] on 星期四, 十一月 03, 2016', 4.0UNITS/MM, ANGDECWKPLAN/XYPLANPRCOMP/ONTECOMP/ONFLY/1.0MODE/PROG, MANSNSET/APPRCH, 2.000000SNSET/RETRCT, 2.000000SNSET/DEPTH, 0.000000SNSET/SEARCH, 10.000000SNSET/CLRSRF, 20.000000RECALL/D(MCS)SNSLCT/S(ROOTSN1)GEOALG/CIRCLE, LSTSQRGEOALG/ARC, LSTSQRGEOALG/PLANE, LSTSQR$$$$MODE/MANF(PLN1) = FEAT/PLANE,CART, -10.468740, -13.405233, 0.000000, 0.000000,$ 0.000000, 1.000000$$ Measurement points are created through actual pointsMEAS/PLANE, F(PLN1), 4 PTMEAS/CART, 17.892973, 38.343311, -0.000000, 0.000000, 0.000000, 1.000000 PTMEAS/CART, -30.462265, 31.063490, -0.000000, 0.000000, 0.000000, 1.000000 PTMEAS/CART, -30.906731, -82.900749, -0.000000, 0.000000, 0.000000, 1.000000 PTMEAS/CART, 1.601064, -40.126984, -0.000000, 0.000000, 0.000000, 1.000000ENDMESOUTPUT/FA(PLN1), TA(XCTL), TA(YCTL), TA(ZCTL)DATDEF/FA(PLN1), DAT(A)D(LEVEL_PLN1) = DATSET/DAT(A), ZDIR, ZORIGF(LN1) = FEAT/LINE,BND,CART, -35.000000, 31.507448, -4.049689, -35.000000,$ -81.657448, -3.630509, -1.000000, 0.000000, 0.000000$$ Measurement points are created through actual pointsMEAS/LINE, F(LN1), 2 PTMEAS/CART, -35.000000, 31.507448, -4.049689, -1.000000, 0.000000, 0.000000 PTMEAS/CART, -35.000000, -81.657448, -3.630509, -1.000000, 0.000000, 0.000000ENDMESOUTPUT/FA(LN1), TA(XCTL), TA(YCTL), TA(ZCTL)F(CIR1) = FEAT/CIRCLE,INNER,CART, 0.000000, 0.000000, -3.971953, 0.000000,$ 0.000000, 1.000000, 30.000000$$ Measurement points are created through actual pointsMEAS/CIRCLE, F(CIR1), 4 PTMEAS/CART, 14.000202, 5.384638, -3.971953, -0.933347, -0.358976, -0.000000 PTMEAS/CART, 11.740457, -9.336041, -3.971953, -0.782697, 0.622403, -0.000000 PTMEAS/CART, -4.061100, -14.439788, -3.971953, 0.270740, 0.962653, -0.000000 PTMEAS/CART, -14.825372, -2.282179, -3.971953, 0.988358, 0.152145, -0.000000ENDMESOUTPUT/FA(CIR1), TA(XCTL), TA(YCTL), TA(ZCTL), TA(TDIAM1_CIR6_1)D(CRD1) = ROTATE/ZAXIS, FA(LN1), -YDIRD(CRD2) = TRANS/XORIG, FA(CIR1), YORIG, FA(CIR1)MODE/PROG,MANF(PLN2) = FEAT/PLANE,CART, 70.799864, -58.453607, -26.747198, 0.258819,$ -0.000000, 0.965926SNSLCT/GSA(ROOTSN1),F(PLN2)GOTO/70.799864, -58.453607, 40.000000$$ Measurement points are created through nominal pointsRMEAS/PLANE, F(PLN2), 4, FA(PLN1) GOTO/CART, 61.338587, -86.089005, -1.953618 PTMEAS/CART, 55.773977, -86.089005, -22.721023, 0.258808, 0.000000, 0.965929 PTMEAS/CART, 54.247299, -72.363586, -22.311951, 0.258808, 0.000000, 0.965929 PTMEAS/CART, 89.110803, -59.417744, -31.653599, 0.258808, 0.000000, 0.965929 PTMEAS/CART, 95.041196, -85.757813, -33.242643, 0.258808, 0.000000, 0.965929ENDMESOUTPUT/FA(PLN2), TA(XCTL), TA(YCTL), TA(ZCTL)F(CIR2) = FEAT/CIRCLE,INNER,CART, 71.914543, -73.999997, -29.116427,$ 0.258819, 0.000000, 0.965926, 11.999999$$ Measurement points are created through nominal pointsRMEAS/CIRCLE, F(CIR2), 4, FA(PLN2) GOTO/CART, 100.088128, -85.757813, -14.407079 GOTO/CART, 79.637013, -75.122193, -8.927219 PTMEAS/CART, 77.093408, -76.693270, -30.504100, -0.863120, 0.448911, 0.231305 GOTO/CART, 74.322959, -74.181864, -29.761760 GOTO/CART, 74.206855, -73.213846, -29.730650 GOTO/CART, 73.741768, -72.365513, -29.606031 PTMEAS/CART, 74.516045, -68.638441, -29.813498, -0.433593, -0.893586,$ 0.116198 GOTO/CART, 72.090213, -71.506621, -29.163498 GOTO/CART, 71.155180, -71.626820, -28.912957 GOTO/CART, 70.335754, -72.108314, -28.693392 PTMEAS/CART, 66.735678, -71.306724, -27.728755, 0.863120, -0.448911,$ -0.231305 GOTO/CART, 69.506127, -73.818129, -28.471094 GOTO/CART, 69.622231, -74.786147, -28.502204 GOTO/CART, 70.087318, -75.634480, -28.626824 PTMEAS/CART, 69.313041, -79.361552, -28.419357, 0.433593, 0.893586, -0.116198ENDMESOUTPUT/FA(CIR2), TA(XCTL), TA(YCTL), TA(ZCTL), TA(TDIAM1_CIR6_1)来源:山涧果子

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