US$0.00
0

SOLIDWORKS Macro to Save Drawing as PDF (Instant Export)

Description

  • This macro is a quick option to get the currently active part or assembly drawing in SolidWorks, saved as a PDF. 
  • The PDF will automatically get the same name and save in the same folder as the drawing. 

System Requirements

  • SolidWorks Version: SolidWorks 2014 or newer
  • Operating System: Windows 7 or later

Pre-requisites

  • The active document must be saved as a drawing (.SLDDRW) file. 
  • The drawing file must contain at least one sheet. 
  • Confirm that the drawing is open and that it is the active document before running the macro.

Results

  • The macro will export all sheets of the active drawing into a single PDF file. 
  • The SolidWorks PDF will be saved in the same directory as the original drawing file, using the same name as the drawing.

Steps to Set Up the Macro

To configure the macro in your SolidWorks environment, complete the following steps: 

  1. Register the Macro File: Start by opening SolidWorks and go to Tools > Macro > New…
  2. Name and Register Your Macro: Provide a descriptive name (i.e., SaveDrawingAsPDF.swp) and then save the file wherever you like on the system. This should automatically launch the VBA editor.
  3. Place the Code: Paste the VBA code provided (located below in the Example VBA Macro Code section) into the VBA editor (ensuring that the default code is overwritten)
  4. Execute the Macro: Close the VBA editor and save it when prompted. 
  5. Assign Shortcut (Optional but Recommended): Either go to Tools > Customize, or Options > Customize, depending on your environment, and:
    • Go to the Keyboard tab. 
    • Filter by Macros in the “Commands” box.
    • Find your saved macro, click in the “Shortcut” box, and enter a preferred key combo (i.e., Ctrl + Shift + P), and you will have an instantaneous SolidWorks PDF export.

This process essentially creates a SOLIDWORKS macro to save drawing as PDF, allowing users to quickly generate PDM files directly from the drawing environment.

VBA Macro Code

Macro

You can download the macro from here.

Need experts’ help for customization?

Contact us today and let us find your custom solutions that fit the automation of SolidWorks your way!

Author

Amen Jlili

Amen Jlili is the founder and technical director of Blue Byte Systems Inc., a software company in Vancouver, Canada, specializing in automating SOLIDWORKS and PDM. With over a decade of experience, he has authored several courses and open-source frameworks related to the SOLIDWORKS API. His leadership ensures that Blue Byte Systems prioritizes customer satisfaction and delivers high-quality software and CAD design solutions.
0
    0
    Your Cart
    Your cart is emptyReturn to Shop
    ×