Good day All,
Is it possible to have an API that takes the metadata stored with a Solidworks drawing in the PDM Vault and append it to the drawing filename? I am looking to take a basic part number which is also the drawing filename and append the desription and revision to the drawing filename. This is counter to the proper use of PDM, but these files need to go into our SAP system.
Here's an example before with description and revision shown in the vault tree:
500M000045_e.SLDDRW
And after:
500M000045_e_Assembly_Top_Level_Widget-rA1.SLDDRW
-Lou
SolidworksApi macros
Yep. You'll need to utilize some of the following Workgroup PDM API methods...
Hope that helps get you started!
Thank you Mike!
I am new to this method - API. I will try and learn my way through it. Thanks for the head start!
-Lou
Well, if you need some tutorials and instructional material, there's always my book! Three chapters are devoted to Workgroup PDM API functions and are pretty much what you're needing. Shameful plug, huh?
http://www.amazon.com/Automating-SolidWorks-2009-Using-Macros/dp/1585034886/ref=sr_1_1?ie=UTF8&s=books&qid=1288720592&sr=8-1
Not at all!
Thanks.
Also, if you're looking for some outside help, check out: www.segerlabs.com.
Mike,
Your shameless plug worked. I purchased your book! Looking forward to using it for my API needs!
-Lou
Excellent! I hope it gets you where you need.
Your shameful plug worked twice. I have your first book and this one looks like it includes even more. Thanks for the all the information I you had included in your first book.
Dan Miel
SW2009
Mike,
I now have your book! Now if I could only figure out how to get past the first chapter. I intend to learn as much as I can before delving into my initial question about PDMworks API. For some reason, I cannot create a SW VSTA VB Macro per your example on page 3! I installed Microsoft Visual Studio thinking the was the reason. It's not! Am I missing other components?
-Lou
Lou
If you are using 2008 or older you will only be able to Save as a VBA Macro. If you have 2009 or newer then at the bottom of the SaveAs dialog box there is a drop down box named "Save as type". You should be able to save as a VBA swp, VSTA VB Macro or a VSTA C# Macro. I don't have my copy here so I'm not exactly certain what is on page 3.
Dan Miel
Hope this helps
I've got SW2010 running. I do have the ability to save as all those types. For some reason, it is not writing the project to the area I've specified. I'll keep looking to see what's wrong... Probably user error.
I've had the same problem on occasion. Each time it was related to a bad installation of VSTA. You can confirm this by trying to create a new macro rather than recording one. If the VSTA UI never appears, it isn't installed properly. You can try updating the installation using vsta_aide.msi found in the SolidWorks installation files (on the DVD or download).
Mike/All,
Another question for you: Will The VB Macro editor work with a 64 bit OS? I am considering converting from 32 to 64 bit to get more use of the RAM on my computer. I am concerned that all the macro learing I am doing will be in vain because they will not work with 64bit OS.
-Lou
Lou
The programs will work fine. Most people have trouble with the dialog boxes hiding behind the SolidWorks window and at first they don't think that the program is running because it looks like SolidWorks has locked up but if you minimize the window or use Alt-Tab you will see you program. I have a module that will bring the box to the front and there is code on this forum if you search for it. I have heard that if you are using the VSTA macros you should be fine.
Dan Miel
SW2010 64 bit
Thanks Dan. I want to be sure before I commit to the change in the OS.
Mike,
I purchased your book a while ago and am now looking into using some of the examples you've published. There are references to samples files which are not part of the book!! Do you have a link to these projects?
-Lou
Lou,
Thanks for picking it up! The download is on the publisher's website...
http://www.sdcpublications.com/Textbooks/Automating-SolidWorks-2011-Using-Macros/ISBN/978-1-58503-620-2/
Once there, click the Downloads tab. The link I have published in the book changed - imagine that!