|
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. |
|