几何尺寸与公差论坛------致力于产品几何量公差标准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, 02:01 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】running solidworks swp file from other programs

running solidworks swp file from other programs
probably a simple answer, but i have an excel spreadsheet that has alot of data in it, all specifically formatted to how it needs to be. i want to take this data and pass it to my sw macro that is already programmed and just use a single line of my excel code.
for this i will be running a loop from excel to move through the rows until all the data has been run against sw.
it will build the custom data type that is already setup in the sw macro.
i will use a public function in the sw macro to accept the data from excel and set a few parameters to make it an automated process, and close windows when it is done with each line of the code from excel..
just how do i call this public function from excel is my question..... remember it is in a swp file that runs in sw already....
almost positive its not possible to call a function from a macro file unless you are in that macro.
your best bet is to copy/paste or export/import the swp macro into the excel file then call it from there
i guess ill export the swp from sw vba and import into excel vba, see if it works like that. i think i will have to add the one the one section of code that calls the swapp to make it work correctly....
only problem with that is, if i updated the one macro, i have to update the other macro so there is no control between the 2...
you could also access the excel spreadsheet from the sw macro. add a reference to excel (under "tools --> references") and create an excel application object in your code to get started.
whatever program runs the macro it can access sw or excel, so you could do this from excel to access sw, or from the sw macro to access excel, or to be daft to prove the example you could have the macro run from word to access excel and sw
well, i am assembling a "engineering tool box" per say that runs from excel, since the data it uses is imported from excel. so in excel i have a menu selection that will create these files for me from the data in excel, that you work with in excel before attemping to use solidworks....
still, not sure if i can completely get this to work correctly, or if there is a better way.
luke, this is part of the programming stuff / questions that i emailed you a couple weeks back about....
and yes, while we are using the api, we should see if we can daisy chain it through like 10 applications before the one we want to get to opens
adam, did i ever give you a reply for the question? i have been really busy and may have overlooked it so will check emails again shortly.
not to that specific one, it was more of implemtation down the line type thing. if you want i can email you the files that will be sent to sw and stuff if you want to look them over..
on a side note, the drawing position, i think i stumped api help on that one
ye sure feel free to email me the files. i won't be able to take a look at them til the weekend as i have just moved house and am renovating shall we say, so my spare time is all taken up atm
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】solidworks macros capabilities yang686526 SolidWorks二次开发 0 2009-04-12 10:29 PM
【转帖】reading solidworks file configuration without opening the file yang686526 SolidWorks二次开发 0 2009-04-12 10:10 PM
【转帖】solidworks macros capabilities yang686526 SolidWorks二次开发 0 2009-04-12 07:40 PM
【转帖】reading solidworks file configuration without opening the file yang686526 SolidWorks二次开发 0 2009-04-12 07:21 PM


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


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