几何尺寸与公差论坛------致力于产品几何量公差标准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-13, 01:03 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】need to auto run a macro on solidworks office pro 2007 start-up

need to auto run a macro on solidworks office pro 2007 start-up
how can i configure / set-up solidworks office pro 2007 to run a macro on start-up?
browse to your program files solidworks dir. find sldworks.exe. rmb and send shortcut to desktop. rmb and edit the properties of the shortcut. change the "target" by adding a space then "/m" "your macro path and macroname.swp"
my example: "c:\program files\solidworks 2008\solidworks\sldworks.exe" "/m" "i:\~jbw-stds\api number generator addin\docnumbersfrommsaccess\insertpartnumber.swp" runs a next partnumber macro at each solidworks session startup.
you can't just edit the target of your solidworks icon because if you try you will find that the target is there but not editable.
also, if you start one macro this way, it could call any other multiple macros that you need to launch at startup as well.
rodney hall - cswp / cad admin / it / product design
president - catawba valley solidworks user group
catawbavalleyswug@gmail.com
swx 2009 sp1.0 / pdmw 2009 sp1.0
dell 690 (2) 2ghz 5130 xeon dual core
4gb ram, xp32 pro sp2
nvidia quadro fx 3450/4000 sdi
edited: 08/15/2008 at 03:12 pm by rodney hall
how do i run a macro from a shell script?
my code:
retval=shell(c:\xxx\solidworks.exe""/m""d:\xxx\xxx.swp")
this does not work?
can you help?
create a wshshell object and use it.
dim wshshell
' ------------------
' create wshshell object
' ------------------
set wshshell = nothing
set wshshell = wscript.createobject("wscript.shell")
if wshshell is nothing then
msgbox ("error: failed to create shell")
wscript.quit 99
end if
wshshell.run ("""c:\xxx\solidworks.exe""" & " /m ""d:\xxx\xxx.swp""")
cadcam systems analyst
-solidworks office premium 2009 sp3.0
-solidworks simulation premium 2009 sp3.0
-solidworks flow simulation 2009 sp3.0
-2 cpu (fx-62), 2.0 gb of ram
-window xp pro sp2
-nvidia geforce 7950 gx2 (512mb) 6.14.11.6921
william,
getting "object variable or with block variable not set" when running with visual basic.??
if not vb do you have code that will work in a .bat??
-regards-
if you want to run a macro every time solidworks starts without fail or shortcut tricks you can create a plugin that simply loads on startup and then calls swapp.runmacro. alternately you can edit the dde settings for .sld* file extensions from explorer->tools->folder options->file types, and add the /m extension to each of the file types in the advanced settings of the "open" command
dennis,
luke has a point and is much more consistent for an upon open do this operation. if you are doing vbs scripting then you can do a wshshell call or if it's bat or cmd scripting can do a start call.
cadcam systems analyst
-solidworks office premium 2009 sp3.0
-solidworks simulation premium 2009 sp3.0
-solidworks flow simulation 2009 sp3.0
-2 cpu (fx-62), 2.0 gb of ram
-window xp pro sp2
-nvidia geforce 7950 gx2 (512mb) 6.14.11.6921
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】macro for loadunload of cosmosworks pro addin yang686526 SolidWorks二次开发 0 2009-04-13 12:36 PM
【转帖】how to tell vb which sub to run firs yang686526 SolidWorks二次开发 0 2009-04-13 12:04 PM
【转帖】execute a sw macro from a macro of another software, is it possible yang686526 SolidWorks二次开发 0 2009-04-13 10:46 AM


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


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