SOLIDWORKS allows for the automation of most actions that a user can perform using its open API.  These macros can be written in a number of languages, including VBA, VB.Net, and C#.  They can then be compiled as a macro file (.swp) or as dll files.  There are some great resources in the SOLIDWORKS forums for macro examples.  There are also websites dedicated to the teaching of writing them.  They are the simplest way to get started with automating SOLIDWORKS.  They are generally written to perform a specific action, with minimal error checking logic, assuming the macro user understands the required input, and desired output of the macro.

Macros can be assigned their own toolbar button, or run from the Tools->Macros menu.  Generally speaking, they are always run inside the SOLIDWORKS session.  Here are some examples of macros the HawkWare team has written:

Bulk Import Components from CSV

Purge Appearances

Rename Fillets with Radii

Write Quantity to Property

Automatically Triggering Macros

 

While macros are generally executed using a macro button or through the menu commands, the HawkWare team created a way to automatically trigger these macros on certain events in SOLIDWORKS, like Open, Save, and Rebuild.  These triggers can greatly enhance the usefulness of macros.  You can try these triggers out for yourself by downloading our free HawkWare Tools for SOLIDWORKS add-in.

Batch Operations

If you need to run a macro against a large number of files, and don’t wish to open each one individually yourself, you can employ the SOLIDWORKS Task Scheduler to perform an “Update” on a group of files.  This operation opens each on in SOLIDWORKS and saves.  It is intended for upgrading between major released.  If your macros are triggered on Open or Save they will be performed automatically.

Our customers have had great success using these together to save significant amounts of time performing repetitive actions.

Need help?

Do you need a SOLIDWORKS macro written?  Contact us to discuss your requirements.

Error: Please enter a valid email address

Error: Invalid email

Error: Please enter your first name

Error: Please enter your last name

Error: Please enter a username

Error: Please enter a password

Error: Please confirm your password

Error: Password and password confirmation do not match