Auto‑Configure

Macro Library

Free SolidWorks VBA Macros

A growing library of ready-to-use SolidWorks macros, organized by Part, Assembly, Drawing and Application level. Click any macro to view the VBA source, then copy it straight into your own macro editor.

Part

Export Active Part to PDF

Exports the currently active part document to a PDF file in the same folder.

Part

Rebuild and Save All Open Documents

Force-rebuilds and silently saves every currently open document, part or assembly.

Part

Toggle Feature Suppression by Name

Prompts for a feature name and toggles it between suppressed and unsuppressed in the active configuration.

Assembly

Export Assembly BOM to Excel

Inserts a parts-only BOM table on the active assembly and saves it directly as an Excel file.

Assembly

Replace Component Reference

Swaps one referenced component in the active assembly for a different part, by name.

Assembly

Zoom to Fit and Save Screenshot

Zooms the active document to fit the window, then saves a PNG screenshot alongside the file.

Drawing

Export Drawing to PDF (All Sheets)

Exports every sheet of the active drawing into a single multi-page PDF.

Drawing

Update Title Block Custom Properties

Prompts for drawn-by and checked-by values and writes them, plus today's date, into the drawing's custom properties.

Drawing

Batch Print Active Drawing

Prompts for a number of copies and sends the active drawing to the default printer.

Application

Batch Export Open Documents to STEP

Loops through every open part and assembly and exports each one to STEP format.

Application

Add Custom Property to All Open Documents

Prompts for a property name and value, then applies it to every currently open document.

Application

Close All Documents Without Saving

Confirms with the user, then closes every open document without saving changes — useful for a clean restart.

No matching macros. Try a different search term or category.

Every macro here is a starting point — test it in a non-production environment and adapt error handling and file paths to your own standards before using it on live data. New macros are added to this library regularly.

Need a macro built around your own workflow?

If nothing here fits exactly, we build custom macros, add-ins and configurators to order.