一.程序设置(Ctrl+D)
默认为‘是’,当使用两个圆构造直线时,软件会自动调用宏程序来保证这条构造出的直线的矢量方向会随着参与构造的两个圆的位置变化而更新。
二.变量数据区宏程序“2PT_TO_LINE”
用途是使用2个实际元素来创建一条理论线;
A.这个宏的意义是使用两个理论元素去拟合一条直线。
例如:测量完成的两个圆;从圆1到圆2构造一条直线。测量和构造的动作将记录DMIS语句,但是运行这个程序,所得到的直线方向有可能为从圆2到圆1。在DMIS语句上这里是没有问题的。
但是如果这条直线用于建立一个零件坐标系,这个坐标系的方向是不合需要的。这个宏就是为了解决这个问题。
B.构造中的拟合。
当一条直线由两个元素拟合时,DMIS语句会按照如下创建。它不再直接由理论定义创建出来,目前会调用EASI_2PT_TO_LINE宏。
$$ 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),(CIR1),(CIR2),(LN_BF1), 0.0000, 0.0000, 1.0000
CONST/LINE,F(LN_BF1),BF,FA(CIR1),FA(CIR2)