Macro library

A library of SOLIDWORKS macros, ready to download.

Every macro here is plain SOLIDWORKS VBA in a .swp file. Each one runs on its own in the VBA editor, and runs across a whole folder unattended inside SwMacroFlow. Open a macro to read its notes, or take the file directly.

  • 16 macros
  • 4 groups
  • Free and MIT licensed
View source repo
Download all (.zip)

16 macros

  1. Change Document Unit

    Sets the document's unit system and the individual length, angle, mass, volume, time, force, power and energy units. Optionally switches inch dimensions to fractions.

    PRT PartsASM AssembliesDRW Drawings

    Utility .swp - download Change Document Unit.swp
  2. Change Drawing Template

    Applies a .slddrt sheet format to one sheet, several named sheets, or every sheet in a drawing, then rebuilds and saves.

    DRW Drawings

    Drawing .swp - download Change Drawing Template.swp
  3. Export Properties to CSV

    Appends every custom property of each document to one CSV. A folder of 300 files produces one spreadsheet, not 300. Works on parts, assemblies and drawings.

    PRT PartsASM AssembliesDRW Drawings

    Properties .swp - download Export Properties to CSV.swp
  4. Find and Replace in Properties

    Replaces text inside custom property values across many files. Works on parts, assemblies and drawings.

    PRT PartsASM AssembliesDRW Drawings

    Properties .swp - download Find and Replace in Properties.swp
  5. Import Properties from CSV

    Writes custom properties into documents from a spreadsheet. Reads the long-format CSV that Export Properties to CSV writes, picks the rows belonging to each document, and writes them.

    PRT PartsASM AssembliesDRW Drawings

    Properties .swp - download Import Properties from CSV.swp
  6. Insert Block In Drawings

    Inserts a .sldblk sketch block at a fixed position on one sheet, several named sheets, or every sheet in a drawing, then rebuilds and saves.

    DRW Drawings

    Drawing .swp - download Insert Block In Drawings.swp
  7. Rename Custom Property

    Renames a custom property across many files. Works on parts, assemblies and drawings.

    PRT PartsASM AssembliesDRW Drawings

    Properties .swp - download Rename Custom Property.swp
  8. Save Drawing as DXF or DWG

    Exports the open drawing to DXF or DWG. Parts and assemblies are reported as unsupported — use Save Neutral Format for those.

    DRW Drawings

    Export .swp - download Save Drawing as DXF or DWG.swp
  9. Save eDrawings

    Exports the open document as an eDrawings file, for sending to people who do not have SOLIDWORKS.

    PRT PartsASM AssembliesDRW Drawings

    Export .swp - download Save eDrawings.swp
  10. Save Neutral Format

    Exports the open part or assembly to Parasolid, IGES, STL, ACIS or 3D XML. Drawings are reported as unsupported.

    PRT PartsASM Assemblies

    Export .swp - download Save Neutral Format.swp
  11. Save PDF

    Exports the open document to PDF. Works on parts, assemblies and drawings.

    PRT PartsASM AssembliesDRW Drawings

    Export .swp - download Save PDF.swp
  12. Save Preview Image

    Captures a bitmap of the open document. Works on parts, assemblies and drawings — on a drawing it captures the active sheet.

    PRT PartsASM AssembliesDRW Drawings

    Export .swp - download Save Preview Image.swp
  13. Save STEP

    Exports the open part or assembly to a STEP file. Drawings are reported as unsupported.

    PRT PartsASM Assemblies

    Export .swp - download Save STEP.swp
  14. Save with Performance Improvement

    Turns image quality down to its cheapest settings — shaded deviation at maximum, high-quality edges off, wireframe quality at its lowest — then saves a copy named <name>_Optimized.

    PRT PartsASM AssembliesDRW Drawings

    Utility .swp - download Save with Performance Improvement.swp
  15. Set Custom Property

    Writes one custom property across every file in the scope. Works on parts, assemblies and drawings.

    PRT PartsASM AssembliesDRW Drawings

    Properties .swp - download Set Custom Property.swp
  16. Write Mass Properties

    Measures the model and writes mass, volume, surface area and centre of mass into custom properties, so a BOM or a drawing note can read them. Parts and assemblies only — drawings have no geometry to...

    PRT PartsASM Assemblies

    Properties .swp - download Write Mass Properties.swp

Put the downloaded file in this folder, then open SwMacroFlow and choose it from the library.

%LOCALAPPDATA%\SwMacroFlow\macros