Your tutorials are GREAT, I can’t stop watching them! I‘ve learned so much in such little time and it’s just the beginning. I can now look at code at figure out what it means, before it was Chinese to me. Thanks for investing the time and providing a great resource!

Bill H.,

Absolutely incredible job. I am very new to programming, and with as little as I know I could easily follow your logic. Even more importantly, I learned a lot. Thank you very much.

Evan D.,

Automating SolidWorks® With VBA

Course Introduction

Description: Why is this course the best API training resource in existence? The answer is here, as well as my recommendation on how you can use it most effectively.
Learn more

Unit 1 : VBA Programming Essentials

Lesson 1.1 – Introduction to VBA

Duration: 06m 10s
Description: In this lesson we introduce you to the Visual Basic for Applications language using the VB editor built into SolidWorks. You will learn how to open, save, edit, and run VBA macros from within SolidWorks. You will write your first macro.
Watch this video

Lesson 1.2 – Using variables

Duration: 23m 17s
Description: Variables contain the numeric, string, or object information you need to work with while coding. In this lesson you will learn how to declare variables, assign values to those variables, and then use those variables.
Watch this video

Lesson 1.3 – Using arrays

Duration: 09m 52s
Description: Arrays are a convenient way to store multiple values in a single variable, making your job as a programmer much easier.
Watch this video

Lesson 1.4 – Conditionals

Duration: 13m 57s
Description: In this lesson we teach you how to use If – Then – Else statements to control which code is run under which conditions.
Watch this video

Lesson 1.5 – Repeating code

Duration: 13m 29s
Description: What if you need to run the same piece of code several times in a row? Here we introduce to various types of code loops.
Watch this video

Lesson 1.6 – Built-In Functions

Duration: 29m 49s
Description: VBA comes with many built-in functions for receiving user input, handling mathematical calculations, string manipulation, dates and time, and more. Learn about them here.
Watch this video

Lesson 1.7 – Modular Programming

Duration: 34m 04s
Description: In order to easily re-use and debug your code, you need to use modular programming techniques. Watch this lesson and learn to avoid some of the pitfalls experienced by amateur programmers.
Watch this video

Lesson 1.8 – User Forms and Controls

Duration: 16m 07s
Description: This lesson shows you how to make your macros user-friendly by incorporating GUIs (Graphical User Interfaces) into your macros.
Watch this video

Lesson 1.9 – Debugging And Error-Handling

Duration: 30m 40s
Description: No one writes perfect code. This lesson shows you the many tools built into the VB editor for identifying and eliminating bugs.
Watch this video

Lesson 1.10 – Working With Files

Duration: 16m 42s
Description: Need your macro to interact with every file in a specific directory? Create a directory? Copy, move, or delete a file? It’s all here.
Watch this video

Unit 2 : Introduction to the SolidWorks API

Lesson 2.1 – Recording And Editing Your First Macro

Duration: 15m 57s
Description: This lesson covers the macro recorder built into SolidWorks, including its uses and limitations.
Watch this video

Lesson 2.2 – Creating Your First Macro From Scratch

Duration: 23m 24s
Description: In this lesson we show the basics of working with the SolidWorks API to create a simple macro. The very important topic of how to use the API Help properly is introduced.
Watch this video

Lesson 2.3 – The SolidWorks API Object Model

Duration: 32m 20s
Description: In this critical lesson, we explain the organization of the SolidWorks API Object Model and how object interfaces are navigated using “accessors”. You will begin to learn about the different document interfaces.
Watch this video

Unit 3 : General document functionality

Lesson 3.1 – Opening, Saving, and Exporting Documents

Duration: 28m 25s
Description: This lesson covers opening, saving, and exporting native and non-native documents with the SolidWorks API. Many tips for using API calls are covered.
Watch this video

Lesson 3.2 – Working With Configurations

Duration: 13m 19s
Description: In this lesson you will learn how to traverse, create, modify, and delete configurations.
Watch this video

Lesson 3.3 – Working With Custom Properties

Duration: 12m 15s
Description: In this lesson we will examine the powerful and efficient ways to use the API to add, delete, and modify custom properties for the document and each configuration.
Watch this video

Lesson 3.4 – Selection

Duration: 24m 17s
Description: This important lesson explores the means of getting pre-selected objects and selecting objects using the SolidWorks API.
Watch this video

Lesson 3.5 – System and Document Options

Duration: 15m 39s
Description: This lesson demonstrates how to control system and document settings with the SolidWorks API.
Watch this video

Unit 4 : Working with parts

Lesson 4.1 – Working With Sketches

Duration: 37m 51s
Description: In this lesson you will learn how to create and dimension sketch entities, as well as traverse existing sketch segments.
Watch this video

Lesson 4.2 – Working With Features

Duration: 24m 31s – 10m 44s – 14m 32s
Description: Since features are such an important part of SolidWorks, this lesson is broken up into three parts: feature creation, feature modification, and FeatureManager tree traversal. In less than an hour you’ll learn crucial techniques that might take you a dozen hours to fully understand on your own. The last lesson, on feature traversal, is particularly critical since the techniques shown apply to assembly and drawing traversal as well.
Watch these videos

Lesson 4.3 – Geometry and Topology Objects

Duration: 19m 56s
Description: This lesson covers the skills foundational to traversal. If you want to take your understanding of API to the next level, you MUST understand the SolidWorks BREP (boundary representation) model, most notably the difference between geometry and topology objects and their key uses.
Watch this video

Unit 5 : Working with assemblies

Lesson 5.1 – Creating A New Assembly

Duration: 45m 09s
Description: In this lesson you will learn to fully automate the creation of an assembly, with particular emphasis given to mating techniques.
Watch this video

Lesson 5.2 – Working With Existing Assemblies

Duration: 30m 54s
Description: In this lesson you will learn more about the IComponent interface, inserting and editing parts, and bounding boxes. For the example, a new solid is inserted to engulf the bounding box of a selected component(s). This is based on a macro used in robotic simulations to simplify the boundaries of surrounding equipment.
Watch this video

Lesson 5.3 – Component Transforms

Duration: 25m 36s
Description: In this lesson you will learn in great depth about the complex topic of component transforms. Many examples covering the fundamentals of component translation and rotation are presented.
Watch this video

Unit 6 : Working with drawings

Lesson 6.1 – Basic Drawing Creation

Duration: 24m 30s – 30m 56s
Description: This lesson covers, in two parts, the five main interfaces related to drawing automation: IDrawingDoc, ISheet, IView, IAnnotation, and ITableAnnotation. The creation of a fairly complex drawing is automated using these five interfaces.
Watch these videos

Lesson 6.2 – Advanced Drawing Creation

Duration: 32m 20s
Description: This lesson expands on the previous lesson by demonstrating advanced functionality, such as identifying view orientation using transforms, adding section views, adding specific dimensions, and using poly-lines.
Watch this video

Lesson 6.3 – Working With Existing Drawings

Duration: 29m 03s
Description: In this lesson you will learn how to write a batch modification macro, using notes and view configurations as an example, as well as print results to a text file.
Watch this video

Unit 7 : Advanced topics

Lesson 7.1 – Using the SolidWorks API with Microsoft Excel

Duration: 13m 34s
Description: In this lesson you will learn how to import data points from an Excel file in order to create a 3D point cloud in a 3D part sketch.
Watch this video

Lesson 7.2 – Notifications

Duration: 20m 13s
Description: This lesson covers the event handling capabilities of the SolidWorks API, beginning with the fundamentals and moving to examples showcasing their best uses.
Watch this video

Lesson 7.3 – Temporary bodies

Duration: 11m 56s
Description: Temporary bodies are used to create bodies without standard features or to increase the performance of tasks involving bodies.
Watch this video

Lesson 7.4 – PropertyManager pages

Duration: 33m 41s
Description: Ever wanted to create macros with SolidWorks-native user interfaces? This lesson will show you how to do just that via PropertyManager pages (PMP). At the end of the lesson we also show you how to create previews using temporary bodies.
Watch this video

Lesson 7.5 – Macro Features

Duration: 43m 47s
Description: This is the only tutorial available that you will walk you through the creation of a macro feature for creating or modifying a body. You will also learn how to control the input body and extrude length with a PropertyManager page. A temporary body preview will be added as well. Finally, you will see the final iteration of the Spike Creator macro that we have been working on in the previous two lessons.
Watch this video

SolidWorks World

Taking Macros to the People: Hands-On For Beginners

Duration: 1h 01m 26s
Description: This presentation was given at SolidWorks World 2012. The advertised description: “Forget abstract talks about object-oriented programming. This hands-on class will get the total beginner on track to unleash the SolidWorks API for greater productivity, using quick and dirty tactics involving the macro recorder, API help, and free cheat sheets.”
Watch this video

Goldmember: 99 Must-Know Methods and Properties of the SolidWorks API

Duration: 1h 12m 30s
Description: This presentation was given at SolidWorks World 2012 in a breakout session called “Goldmember: 99 Must-Know Methods and Properties of the SolidWorks API”. The advertised description: “The SolidWorks API is big. Really big. Like any language, however, you only need to know 5% of the words to accomplish 95% of what you need. This session will look into what’s important and what’s not, covering feature creation, object traversal, selection techniques, and much more.”
Watch this video