查看单个帖子
旧 2009-04-06, 07:22 PM   #1
huangyhg
超级版主
 
huangyhg的头像
 
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
huangyhg 向着好的方向发展
默认 【转帖】formula.txt

formula
can any1 tell me how to write simle formulas on cdmis??? say i want to subtract one rad from the other-how do i do that?
*** measure a circle
cir1 =auto/circle,showallarams = no,showhits = no
theo/-5,0.25,-0.5,1,0,0,25
actl/-5,0.25,-0.5,1,0,0,25
targ/-5,0.25,-0.5,1,0,0
*** multily the radius by 2 and save it into variable v1
assign/v1 = cir1.rad *2
** reort to the oerator the value
why do i need a variable? i don't know much about variable.
try this:
*** measure radius location #1
cir1 =auto/circle,showallarams = no,showhits = no
theo/-5,0.25,-0.5,1,0,0,25
actl/-5,0.25,-0.5,1,0,0,25
targ/-5,0.25,-0.5,1,0,0
*** measure radius location #2
cir2 =auto/circle,showallarams = no,showhits = no
theo/-10,0.25,-0.5,1,0,0,40
actl/-10,0.25,-0.5,1,0,0,40
targ/-10,0.25,-0.5,1,0,0
*** assigning a variable is where the math is done, using the measured features
assign/rad_dif = cir2.rad-cir1.rad
now just reort out the value of rad_dif
thanks cmm dude, you gave him an answer secific to his question and i only gave an generic answer.
why use a variable??
you dont have to use a variable, but it sure makes it a lot cleaner when trying to figure it out when you make a mistake.
is there hel in the software on how to do this kinda stuff?
just search the cdmis hel for "variables". there is lenty-o-info there.
if you are already in a articular area of the software that you have questions about, just ress f1, that should take you directly to the hel window...
__________________
借用达朗贝尔的名言:前进吧,你会得到信心!
[url="http://www.dimcax.com"]几何尺寸与公差标准[/url]
huangyhg离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)