Blog - Design Automation

Design Automation and SolidWorks API and Macros

Design Automation

Paul Gimbel provided in SlideShare website some few things about automation that each designer should know:1
  • 100% automation is generally unachievable.
  • Typically, the last 10% of automation will not be worth it.
  • Something you didn’t plan for will always come up.
  • Your drawings are probably going to require clean-up.
  • Testing will take you far longer than you expect.
  • Your system will require ongoing maintenance and updates.

Design automation is a time-saver that is used to reduce the design cycle time by providing consistency and repeatability, which are two things that are essential in capturing and sharing efficient design methods. Design automation results to a quicker development and a shorter time to market which in turn results to a reduced total design cycle time and an increase in profitability.4

Design Automation with SolidWorks Macros and API

The SolidWorks API (Application Programmer’s Interface) is a “group of functions that provides direct access to SolidWorks functionality.” Examples of such functionalities are creation of a line, extruding a boss, or outputting a file format. The SolidWorks API is the gateway to the automation of repetitive tasks such as batch plotting, custom property access, or assembly “configurators.” [5]

A page in DesignPoint Solutions provides some examples of what SolidWorks API can do:5

  • Creating an application that can take any sheet metal part, generate its flat pattern and output it as a DXF file for use in a manufacturing environment
  • Creating an application that can take all the drawings associated with a project and can print them at one time with no user interaction
  • Creating an application that controls the custom properties of a part within the company standards that you define
  • Creating an application that would take the input of a sales person, build a custom design and automatically generate an eDrawing of the new product for delivery to the customer
  • Creating an application that could access any project, query the design, generate a Bill of Materials and output it in a format suitable for MRP integration
  • Creating an application that could generate a custom hole chart based on a coordinate system and any part

Macro information is the “recording of the modeling commands sequence or the modeling history.”2 SolidWorks macros are un-compiled “programs written in Visual Basic for Applications, VBA for short,” although it can also be programmed using any software that supports COM (Component Object Model). VBA is the “most common COM-supporting development environment.” To save time, macros are used to simplify or automate tasks that are constantly being repeated.3

The words “macro” and “API” are sometimes used interchangeably. The difference lies in their nature. APIs are compiled programs, such as add-ins or some external executables, while macros are un-compiled programs.3


1Gimbel, Paul. “Design Automation: Simple Solid Works Solutions to Practical Programmatic Packages.” Razorleaf. 15 Sep 2009. 3 Jan 2011 <>.
2Kim, Byungchul, and Soonhung Han. “Integration of History-Based Parametric Translators Using the Automation APIs.” International Journal of Product Lifecycle Management 2.1 (2007): 18-29. 4 Jan 2011 <>.
3CharlesCulp. “Macros and API.” SolidMentor. 29 Nov 2007. 3 Jan 2011 <>.
4Nikolic, Dragomir M. An Improved Method and Apparatus for Automated Design and Verification of Integrated Circuits. Kentucky: University of Kentucky, 2005. 3 Jan 2011 <>.
5“Training – SolidWorks API Fundamentals and Intro to VB Programming.” DesignPoint Solutions. 13 Aug 2010. 3 Jan 2011 <>.