This page contains a collection of useful macros and utilities for SOLIDWORKS engineers.


Capture SOLIDWORKS Commands

Macro allows capturing SOLIDWORKS and user commands into the list box

Identify Feature Definition And Specific Type

Helper methods allowing to identify the definition and specific type of the selected feature via SOLIDWORKS API and reflection


Close All Documents Except Active

Closes all opened documents except of an active one using SOLIDWORKS API

Run Group Of Macros

Macro demonstrates how to run the group of macros within one macro using SOLIDWORKS API

Load/Unload Add-In

Macro to trigger (load/unload) the specified add-in using SOLIDWORKS API


Export All Document Options To Excel

Macro allows to export all document properties into excel format using SOLIDWORKS API and reflection

Custom Properties

Copy File Specific Custom Properties To Configuration Properties

Macro copies all the file specific properties into the properties of the active configuration

Rename Configurations Based On Custom Property

Macro renames all configurations of assembly or part into the value of the specified configuration specific custom property


Write Data From Excel Table Into General Table

Macro will read all the data from the Excel table and import it into the new general table of the active document or update existing table

Export Table To CSV

Macro exports selected table (BOM, General Table, Revision etc.) into CSV format allowing to export with or without header preserving the special symbols like comma (,) and new line symbol

Automatically Run Macro On Rebuild

Macro allows to automatically run macros on every rebuild using the macro feature and designed binder attachment with SOLIDWORKS API

Delete Feature Folder With All Children Features

Macro allows to delete all of the features in the selected folder in one click

Rename All Features Sequentially

Macro renames all the features in the order preserving the base names

Suppress Features In New Configurations

Macro create new configurations for all features selected in the feature tree and suppresses them one by one in the respective configuration using SOLIDWORKS API

Delete All Equations From SOLIDWORKS Model

Macro removes all of the equations (or optionally only broken equations) in the active model (part or assembly)

Create Configuration With Average Dimension Values

Macro will create child configuration where all the dimension will be set to average value based on the minimum and maximum values of the tolerance

Find-Replace Text In Dimension Names

Macro replaces the text in the dimension names of the selected feature or features

Exclude Selected Bodies From Cut-Lists

Macro excludes the solid bodies selected from the graphics area or from the feature tree from weldment or sheet metal cut-list

Part Geometry Diff

Diff tool to find the geometrical difference between multi-bodies parts using SOLIDWORKS API

Create Precise Bounding Box

Macro creates a precise bounding box in the part document using SOLIDWORKS API

Display Callouts With Diameters For All Selected Circular Edges

Macro will display the callouts with the diameter values of all selected circular edges in the 3D model


Increment The Numeric Value In The Note

This macro increments the numeric value of the notes by matching regular expression (e.g. incrementing the revision)

Rename Drawing Sheets With Custom Properties Values

Macro will rename all drawings sheets using the value of the specified custom property

Change Layer For Selected Objects In Drawing

Macro will move all selected objects in the drawing sheet to specified layer

Update Referenced Configuration From BOM Tables

Macro will update the referenced configurations for all Bill of Materials (BOM) tables on the active drawing document


Add Watermark Feature

Adds the watermark feature (license) with custom message and name which cannot be deleted or edited


Copy Custom Property From Material To Model

Macro demonstrates how to copy the specified custom property from the material database to the model custom property


Suspend Rebuild Operation

This macro allows to suspend rebuild operation for parts, assemblies and drawings to enhance the performance


Hide All Sketches

Macro will hide (blank) or show (unblank) all sketches (2D and 3D) in the active document

Import Points Cloud From CSV File Into Sketch

Macro imports the points cloud from the specified CSV file into the active 2D or 3D Sketch using SOLIDWORKS API

Create Sketch Points On Selected Edge

Macro creates specified number of sketch points on the selected edge in the 3D sketch


Remove All Colors From Part

Macro demonstrates how to remove all colors from the part document on all levels (face, feature, body) using SOLIDWORKS API


Break All External References For Components

Example will break all external references for all components in the active assembly

Show Selected Assembly Component In The Window Folder

Example demonstrates how to open the folder of the selected component in the assembly in the Windows File Explorer

Advanced Selections

Macro adds additional selection criteria to the advanced selection tool allowing to select components which are excluded from bom, envelope, float etc.

Export Components Positions

This macro exports positions of components to an external CSV text file

Move To Folder

Macro move the components selected in the graphics area into a new folder in the feature manager tree

Count All Selected Components

Macro counts all unique components selected in the assembly and displays the result in the commands bar

Replace Components

Macro demonstrates how to replace selected components in the batch preserving original selections using SOLIDWORKS API

Copy Component Path

Macro copies the path of the selected component in assembly or drawing into the clipboard

Components Configurations Permutation

Macro performs a permutation for each components in the root level of the assembly using SOLIDWORKS API and saves the results as individual files


Export Files

Script allows exporting of the SOLIDWORKS file into the foreign format using command line

Export Component To STL

Macro exports selected assembly component to stl format without the need of activating the document

Motion Study

Animate Configurations

Macro demonstrates how to create an animation from configurations to represents model history or sheet metal folding


Split Body By Faces

Macro splits the selected surface or solid body by faces creating individual sheet body for each face using SOLIDWORKS API

© 2019. All rights reserved.
Terms Of UsePrivacyCookies