I have a bunch of files where the last design person put revs in the file names.
I would like to truncate the file names to remove the extra, and update the references.
Any good way to do this?
You should use the document manager. Open up the local API Help (make sure that Help-->"Use online help" is unchecked") and go to the Contents tab, then the Document Manager section (see attached image), read the "Welcome" and "Getting started" section.
"The SolidWorks Document Manager API ... allows you to write applications that emulate file management tools to perform such tasks as renaming, replacing, and copying SolidWorks documents."
It can be tedious browsing all of the members of the swdocumentmgr namespace so attached is a video scrolling them all so you can search it a little quicker.
Also, here is a good blog post on the doc man.
Video Tutorials for the SolidWorks API
Thanks for the answer on it. I guess I will have to dig in my brain to my VB classes. Was hoping to find one I could modify on the web but the software code seems to preclude that.
Tim, when you say "VB" are you referring to VBA macros, VB.NET macros, or VB.NET add-ins? Macros that utilize documentmanager are pointless because you have to have SolidWorks open to run the macro, which would defeat the point of using doc man. Also if you try to run doc man and have SolidWorks open at the same time and have them both modifying a modify simultaneously then you can rub into serious problems.
DocMan should be used with add-ins, so in your case if you know VB then that means a VB.NET add-in.
Visual Basic. I took a class on it a long time ago....probably need a new class on it.
This one seems over my head. I don't understand where to even start.
If you looking for a book, check this one:http://www.angelsix.com/cms/features/books
If you looking for video tutorials, check here: Video Tutorials for the SolidWorks API
If you looking for examples/website for macro example, then the forum itself is full of tons of examples. Some of the other sites to look at are:
Lorono's SolidWorks Resources
Lenny's SolidWorks Resources
Angelsix SolidWorks Macros
3DCC Free SolidWorks Macros
If you want to learn VBA within the SolidWorks environment, my course "Automating SolidWorks With VBA" covers the basics for free.
If you want to learn VB.NET, I would recommend PluralSight.
VBA is the same language used in Microsoft Office to write macros. It is based on Visual Basic 6.0 so it has been around a while and is simpler to learn than VB.NET. VB.NET is basically the successor to Visual Basic 6.0 so it is more powerful but more complex. To use the document manager properly you will need to learn VB.NET, though if you are new to API programming I would recommend starting out with VBA since it is so much simpler. I recently wrote a blog post that might interest you: 7 Mistakes that New SolidWorks API Programmers Make.
Retrieving data ...