New type of SaveAsPDF macro

SolidWorks is able to save drawings and current model views as a PDF format file.  SaveAsPDF with Folder SelectionThere’s been a lot of macros written over the years that cut the process of saving as PDF down to as few steps as possible. One of the long standing requests for this type of macro (and many similar types of macros) is to allow the user to pick the save location. Just uploaded is a macro (SaveAsPDF with Folder Selection) that does just this, and simplifies the location selection process for default folders. This new macro also uses more modern API techniques to save the file (using modelext::saveas instead of model::saveas4).

This macro does many things that previous macros haven’t.  While allowing the user to establish a default save location folder, it also provides automatic alternative choices when the default is not available.  Yet, even with all of these, the user can still override automated selection and pick a new location.  It does all of this without the use of VB6 forms.

As with other macros that do similar tasks, this will work best when assigned to a keyboard shortcut or a toolbar icon.   Also, as with all SolidWorks macros, there is a chance it will not work “out-of-the-box”.  This is normally due to the fact that SolidWorks updates core reference libraries with each release.  If errors are encountered, simply re-reference to the libraries that are available to allow the macro to function.  More information about that is available in this previous article.

Author: fcsuper

As a drafter, mechanical designer and CAD engineer, I've been in the mechanical design field since 1991. For the first 8 years of my career, I was an AutoCAD professional. I utilized AutoLISP and many other AutoCAD customization features to streamline drafting activities for 6+ drafters and designers. I authored several custom functions, one of which was published in the March 1997 issue of Cadalyst Magazine. Since 1998, I've been used SolidWorks non-stop. I've worked to utilize the SolidWorks' user environment to simplify drafting and design activities for 20+ engineers. I've created this website to provide current information about SolidWorks from a variety of contributors. More recently, I am now employed by Dassault Systemes as SOLIDWORKS Sr. Product Definition Manager to improve drawing, annotation and MBD related areas.

3 thoughts on “New type of SaveAsPDF macro”

  1. This macro works fine, and I’ve modified it so it can extract the “Revision” property from the drawing and add it to the name of the PDF file, but it does not let you rename the file “On the Fly”. It would be better if there was a way, like in many other programs, to rename the file to what-ever you want before it is saved.

  2. Don, the macro is streamlined to provide as quick of a workflow as possible to create a PDF while still offering some options. It would be a simple matter to modify the file naming section to require input within a msgbox. Feel free to make that modification for your usage.

Leave a Reply

Your email address will not be published. Required fields are marked *

By submitting a comment here you grant this site a perpetual license to reproduce your submitted words and name in attribution. Please note, comments are moderated to cut spam, so they may not appear instantly when submitted.

This site uses Akismet to reduce spam. Learn how your comment data is processed.