几何尺寸与公差论坛

 找回密码
 注册
查看: 761|回复: 0

【转帖】modify equations

[复制链接]
发表于 2009-4-12 21:49:01 | 显示全部楼层 |阅读模式
modify equations
hi!
how´s things?
i create some equations: a=100; d2@croquis1=a but i want to change to ae=100; d2@croquis1=ae.
how can i do this? i was looking api up and there isn´t any sentence to modifiy equations.
i need our help!
thank u! regards!
edited: 02/10/2009 at 06:02 am by marian ruiz
go to tools > equations, select the equation and click edit to edit the selected equation.
deepak gupta
sw2007 sp5.0
sw2009 sp2.1
ok, i know this choice, but i wat to do by code.
edited: 02/10/2009 at 06:38 am by marian ruiz
try this
***
dim swapp as object
dim part as object
dim boolstatus as boolean
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
part.deleteallrelations
part.addrelation """ae""=100"
part.addrelation """d2@croquis1""= ""ae"""
end sub
deepak gupta
sw2007 sp5.0
sw2009 sp2.1
use the equationmanager object.
i'll get you eh steve, if it's the last thing i dooooo!
dim swapp as sldworks.sldworks
dim myprt as sldworks.modeldoc2
sub main()
set swapp = application.sldworks
set myprt = swapp.activedoc
dim eqmr as sldworks.equationmgr
dim i as long
if not (myprt.gettype = swdocdrawing) then
set eqmr = myprt.getequationmgr
for i = 0 to eqmr.getcount - 1
debug.print eqmr.equation(i)
if eqmr.equation(i) = "d2@croquis1=a" then
eqmr.equation(i) = "d2@croquis1=ae"
debug.print "changed d2 equation"
elseif eqmr.equation(i) = "a=100" then
eqmr.equation(i) = "ae = 100"
debug.print "changed a equation"
end if
next i
end if
end sub
i'll get you eh steve, if it's the last thing i dooooo!
yes, i did this but i have problems with the ". because when you add a equation in the equation manager yo have to write like this: """d2@croquis1"" = ""ae"""
and i have soo much problems to add " by code.
try
"''""[email="d2@croquis1""''"]d2@croquis1""''[/email] = ''""ae''"""
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 10:12 , Processed in 0.035239 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表