几何尺寸与公差论坛

 找回密码
 注册
查看: 816|回复: 0

【转帖】launch pack and go from api

[复制链接]
发表于 2009-4-13 12:28:23 | 显示全部楼层 |阅读模式
launch pack and go from api
is there a way via api (i suppose command line would be acceptable too) to launch the pack and go utility passing it the drawing/part/assembly as a parameter? i am currently developing an app that it would be useful to allow the user to launch the pack and go interface from within (i am aware of performing pack and go functionality manually, but why re-invent the wheel for the prefix/suffix etc options).
thank you!
not as i am aware but you can easily make your own and use the sldworks::copydocument function.
my apologies in my first post -- i am aware of performing the pack and go functionality manually in code (which is what i forgot to include) via the copydocument function. there is a common user interface as seen from solidworks explorer, windows explorer (pack and go), and solidworks (file->pack and go). my guess is that all of these are calling the same code, so it would be intuitive that i should call this code/wrapper as well too. i did find sldshellutilslib.sldcopydesign2class from the sldshellutils 1.0 library, but i am unable to get it to function without error (when called, it returns false or throws an exception). i have not found any documentation for this class/function. i appreciate the response!
cheers!
you are right that is the dll that is loaded into the process when windows/sw explorer open p&g, and the only avaiable exports exposed are copydesign, drawingsearchfolders and launchedfromsolidworks, and so the only function you can call is copydesign. i have tried calling it but what appears to cause the crash is the int passed in as the parent hwnd. i have tried passing 0 but no crash and nothing happens, and passing the forms hwnd crashes it. i may try the desktops hwnd when i get time to have another play. here is what i tried:
sldcopydesign2class s = new sldcopydesign2class();
s.launchedfromsolidworks = 0;
s.drawingsearchfolders = "c:\\";
s.copydesign(true, "c:\\test.sldprt", this.handle.toint32());
i have tried with and without the 2 properties being set, and with the handle changing, but no luck.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 13:55 , Processed in 0.036762 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表