几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-04-12, 09:49 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】modify equations

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
"''""d2@croquis1""'' = ''""ae''"""
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】insert equations api yang686526 SolidWorks二次开发 0 2009-04-12 09:28 PM
【转帖】insert equations api yang686526 SolidWorks二次开发 0 2009-04-12 06:43 PM
题: 《数值分析方法库》(Numerical Recipes)3rd Edition 配套光盘 huangyhg 数学基础库 2 2008-11-18 01:08 AM


所有的时间均为北京时间。 现在的时间是 08:50 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多