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


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


回复
 
主题工具 搜索本主题 显示模式
旧 2007-09-04, 01:06 PM   #1
huangyhg
超级版主
 
huangyhg的头像
 
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
huangyhg 向着好的方向发展
默认 1-354247171 - Automating cylinder creation in SW API

ear Daniel,
Thank you for contacting SolidWorks API Support.
Please look at the method "AssemblyDoc::InsertNewPart2". Attached is a
macro which I have recorded to perform the cylinder creation operation
in the assembly.
In the macro, please put the path and filename for the new part in the
"InsertNewPart2" method.
I hope this helps.
Regards,
Pabitra
Pabitra Behera | API Support
www.solidworks.com | www.solidworks.com/api
Date Opened : 9/13/2006 05:18:46 AM
Summary : Automating cylinder creation in SW API
Description : Hi,

Is there a simply set of commands I can use to automate the creation of
a cylinder in an assembly? I am using VB 6.

Thanks.

Daniel Brown
Robotics Engineer
Accuray, Inc.
ACCURAY: Enabling full-body radiosurgery using image-guided robotics
1310 Chesapeake Terrace
Sunnyvale, CA 94089
408-716-4600 x4830 (Office)
__________________
借用达朗贝尔的名言:前进吧,你会得到信心!
[url="http://www.dimcax.com"]几何尺寸与公差标准[/url]
huangyhg离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
旧 2007-09-04, 01:07 PM   #2
huangyhg
超级版主
 
huangyhg的头像
 
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
huangyhg 向着好的方向发展
默认 回复: 1-354247171 - Automating cylinder creation in SW API

Hi Pabi,
Thanks for your recent help on automating the creation of cylinders in
SW.
I have another question in connection with the same project I'm working
on.
Basically, I'm trying to generate a number (as much as 150 in some
cases) of cylinders and insert them into an assembly, which in turn is
inserted into another assembly. The problem is that Sw complains that it
runs out of memory space at around the 30th cylinder even though I close
all the cylinder part files.
Is there a way I can turn off something (may be auto saving or whatever)
that can solve the problem? I must be able to insert all 150 *for
instance) into the assembly in one move. I am attaching a sample file
fyi. <<Trigem_G4_M_Path3.SLDPRT>>
Thanks in advance for your help
Daniel Brown
__________________
借用达朗贝尔的名言:前进吧,你会得到信心!
[url="http://www.dimcax.com"]几何尺寸与公差标准[/url]
huangyhg离线中   回复时引用此帖
旧 2007-09-04, 01:08 PM   #3
huangyhg
超级版主
 
huangyhg的头像
 
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
huangyhg 向着好的方向发展
默认 回复: 1-354247171 - Automating cylinder creation in SW API

Hello Daniel,

Make sure to destroy all the object created inside the loop before you
go to process the next. As an example in VB:

Set swFeature = Nothing
Set swSketch = Nothing etc.

This will help in releasing the memory.

Also you can use DoEvents function. Use this in between the major
operation like Opendoc, ForceRebuild, Or Save etc.(Please refer to the
DoEvents in MSDN for better understanding)

I hope this helps.

Regards,
Pabitra
__________________
借用达朗贝尔的名言:前进吧,你会得到信心!
[url="http://www.dimcax.com"]几何尺寸与公差标准[/url]
huangyhg离线中   回复时引用此帖
旧 2007-09-04, 01:08 PM   #4
huangyhg
超级版主
 
huangyhg的头像
 
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
huangyhg 向着好的方向发展
默认 回复: 1-354247171 - Automating cylinder creation in SW API

Hi Pabi,

I tried all the suggestion you gave but I'm running into the same
problem. Will it make a difference if I suppressed on the previously
inserted cylinders before attempting to create and insert another one?

Thanks

Daniel Brown
__________________
借用达朗贝尔的名言:前进吧,你会得到信心!
[url="http://www.dimcax.com"]几何尺寸与公差标准[/url]
huangyhg离线中   回复时引用此帖
旧 2007-09-04, 01:09 PM   #5
huangyhg
超级版主
 
huangyhg的头像
 
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
huangyhg 向着好的方向发展
默认 回复: 1-354247171 - Automating cylinder creation in SW API

Hi Daniel,

Definitely it will make a difference. A suppressed component is removed from memory, so loading speed, rebuild speed, and display performances are improved. Because of the reduced complexity, evaluation of remaining components occurs faster.

Also, you should look into “Work with Lightweight Components” (see API help file).

Regards,
Pabitra
__________________
借用达朗贝尔的名言:前进吧,你会得到信心!
[url="http://www.dimcax.com"]几何尺寸与公差标准[/url]
huangyhg离线中   回复时引用此帖
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
How to start SW 2007 or SW 20006 via SW API? If I have two different versions of SW yogy SolidWorks二次开发 1 2007-05-21 09:19 AM
【转帖】对于hook函数的一点认识 huangyhg vc编程 0 2007-03-27 11:53 AM


所有的时间均为北京时间。 现在的时间是 01:20 PM.


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