几何尺寸与公差论坛------致力于产品几何量公差标准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:38 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】macro for inserting and mating a new part in an assembly

macro for inserting and mating a new part in an assembly
i know there must be one out there but i can't find it!
does anyone know where i can get a macro that when run inside an assembly creates a new part, asks for file name and save location then inserts that part into the active assembly setting it to fixed or mated?
i've tried recording a macro but of course i don't know how to get it to ask for user input a the save stage.
thanks for your help. very much appreciated.
hi scott,
the functionality you describe was more or less how solidworks worked prior to sw2008 when using the 'insert new part' function.
i don't like the virtual component functionality introduced in sw2008 - or to be more precise i don't like that i am forced to use it. it gives me an extra step in the process because i always save out the parts. is that the same reason you have for such a macro?
i don't know if a ready-made macro can be found somewhere. i will be happy to assist you with specific questions/problems if you have something to start with.
jorn bjarning
cswp
cad & plm consultant
sw2008 sp5 / sw2009 sp2
using common dialog from vb
thanks for your comments jorn. i do like the virtual feature functionality and use it quite a bit for things like fasteners and gaskets that aren't actually modeled in the assembly but need to appear in the bom. however when i do this it's from within a drawing by right clicking on the bom and selecting "insert new part". when in an assembly i never use it and as you say, resent being forced to which adds the extra work. i would appreciate the option of being asked for a file name and have lodged a enhancement request. i as you say, always save out the parts and so want to revert to the old behavior.
anyway, back to the topic of a macro...
i know nothing of vb but have decided to learn since many if not all my enhancement requests can be solved with macros. all i have done is to use the record macro function which has produced the desired result only it doesn't give the option to nominate the new part name or save location. i just need to find the vb function that brings up the dialogue box for user input. i have tried to upload it up get an error.
ivan,
as mentioned i know zip about vb... so i just ran the macro within an open assembly you attached and it starts a new part file but does not insert it nor give me the option to name it. what is the intended usage of the macro?
i am off to buy a vb book today! thanks
edited: 03/15/2009 at 07:34 pm by scott manning
here is the macro...
scott,
in my macro, if you choose tools -> references, are you missing "microsoft common dialog control" ?
originally posted by: scott manning
here is the macro...
scott,
stay tuned. the next couple of days i am busy with meetings and things to do so i am not able to assist you right now. i will get back to you later this week (if you still need help).
jorn bjarning
cswp
cad & plm consultant
sw2008 sp5 / sw2009 sp2
originally posted by: ivana kolin
in my macro, if you choose tools -> references, are you missing "microsoft common dialog control" ?
arrr yes. i see in there where there is no file reference - which causes the error. i got that far. so your macro then calls the dialogue control which allows the data to be entered?
i don't have that control available in the "references" as you mention. i'll go and have a google and track it down.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】inserting and mating parts in an assembly yang686526 SolidWorks二次开发 0 2009-04-12 09:28 PM
【转帖】inserting and mating parts in an assembly yang686526 SolidWorks二次开发 0 2009-04-12 06:43 PM
【转帖】initiate a browse for file function yang686526 SolidWorks二次开发 0 2009-04-12 06:42 PM


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


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