获取元素的理论值/实测值 ,以及触测点的理论值/实测值。OBTAIN语句设置变量与DMIS项目的属性值相等,格式如下:变量名称=OBTAIN/标签,序号变量名称:已定义的变量名。标签:元素、公差、探头。序号:数字编号,分别代表不同的属性。各元素输出项目与编号对应关系RE注意: 获取元素的理论值/实测值 ,以及触测点的理论值/实测值。不用提前定义变量,在获取语句前默认添加了定义变量的指令。1.OBTAIN函数的作用是把之前设定的一些参数通过变量赋值得到.例如各个元素的坐标值和参数值,在HLL编程中用到很频繁.以圆为例,圆的定义语句为F(CIR1) = FEAT/CIRCLE,OUTER,CART, 10, 20, 30, 0, 0, 1,25上面的定义语句定义了一个X值为10,Y值为20,Z值为30,直径为25,所在平面方向为0,0,1的外圆那么我的取值语句为,假设前面声明过一个DOUBEL型变量为Demo1Demo1 = OBTAIN/F(CIR1),X那么当X为4的时候,Demo1取得的是该圆的X值.当X为5的时候,Demo1取得的是该圆的Y值.当X为6的时候,Demo1取得的是该圆的Z值.当X为7的时候,Demo1取得的是该圆的i值.当X为8的时候,Demo1取得的是该圆的j值.当X为9的时候,Demo1取得的是该圆的k值.当X为10的时候,Demo1取得的是该圆的直径. 很明显,在对元素的参数进行取值的时候,刚好是从元素定义语句的第一个参数依次向后数,如上面的例子,取值的顺序刚好就是元素定义的顺序.其它元素参数的取得也遵循这个规律.Note:This statement allows any parameter following the '/' delimiter from any DMIS statement having a label to be obtained, and assigned to a variable name. Where tolerances apply, OBTAIN will retrieve the tolerance statement(s) in the last EVAL and/or OUTPUT statements, for that label name of TA label type.For example:EVAL/FA(label1),T(label1)var=OBTAIN/TA(label1),32.OBTAIN语句例子(1) 将圆的理论X、Y、Z、D值输出到变量。DECL/COMMON,REAL,CIR1_XCIR1_X = OBTAIN/F(CIR1),4DECL/COMMON,REAL,CIR1_YCIR1_Y = OBTAIN/F(CIR1),5DECL/COMMON,REAL,CIR1_ZCIR1_Z = OBTAIN/F(CIR1),6DECL/COMMON,REAL,CIR1_DCIR1_D = OBTAIN/F(CIR1),10 拖放理论圆到实数(2) 将圆的实测X、Y、Z、D值输出到变量DECL/COMMON,REAL,CIR1_X_1CIR1_X_1 = OBTAIN/FA(CIR1),4DECL/COMMON,REAL,CIR1_Y_1CIR1_Y_1 = OBTAIN/FA(CIR1),5DECL/COMMON,REAL,CIR1_Z_1CIR1_Z_1 = OBTAIN/FA(CIR1),6DECL/COMMON,REAL,CIR1_D_1CIR1_D_1 = OBTAIN/FA(CIR1),10拖放实测圆到实数(3)元素触测点(PTMEAS)的序数3.获取公差的偏差值KNPTR3=OBTAIN/TA(TCIR1),24.获取探头数据DECL/COMMON,REAL,L20_D2_0_DXL20_D2_0_DX = OBTAIN/SA(L20-D2.0),2DECL/COMMON,REAL,L20_D2_0_DYL20_D2_0_DY = OBTAIN/SA(L20-D2.0),3DECL/COMMON,REAL,L20_D2_0_DZL20_D2_0_DZ = OBTAIN/SA(L20-D2.0),4DECL/COMMON,REAL,L20_D2_0_FL20_D2_0_F = OBTAIN/SA(L20-D2.0),5DECL/COMMON,REAL,L20_D2_0_FL20_D2_0_F = OBTAIN/SA(L20-D2.0),75.批量取值DECL/COMMON,REAL,GR_1_ZGR_1_Z = OBTAIN/FA(GR-1),5DECL/COMMON,REAL,GR_2_ZGR_2_Z = OBTAIN/FA(GR-2),5DECL/COMMON,REAL,GR_3_ZGR_3_Z = OBTAIN/FA(GR-3),5DECL/COMMON,REAL,GR_4_ZGR_4_Z = OBTAIN/FA(GR-4),5DECL/COMMON,REAL,GR_5_ZGR_5_Z = OBTAIN/FA(GR-5),5DECL/COMMON,REAL,GR_6_ZGR_6_Z = OBTAIN/FA(GR-6),5DECL/COMMON,REAL,GR_7_ZGR_7_Z = OBTAIN/FA(GR-7),5DECL/COMMON,REAL,GR_8_ZGR_8_Z = OBTAIN/FA(GR-8),5DECL/COMMON,REAL,GR_9_ZGR_9_Z = OBTAIN/FA(GR-9),5 来源:山涧果子