You are on page 1of 4

© Dassault Systèmes | Confidential Information | 2/16/2021 | ref.

: 3DS_Document_2020

How To Write Powerful Macros From Scratch


Technical Director, CADSharp LLC
Keith Rice
Presentation Overview
 Macros are small programs that run inside of another program that extend a
software’s capabilities.
© Dassault Systèmes | Confidential Information | 2/16/2021 | ref.: 3DS_Document_2020

 In this presentation, we’ll use a macro to speed up a repetitive task.

 Takeaways
 Recognize how quickly one can write a powerful macro.
 Learn how to navigate the SOLIDWORKS API local help.
 Understand the SOLIDWORKS API object model.
 This presentation assumes you have basic familiarity with programming.

2
Case Study
 In 2015, a student from California Polytechnic State University emailed me
with this problem:
© Dassault Systèmes | Confidential Information | 2/16/2021 | ref.: 3DS_Document_2020

“I have an imported model of a skull with 300 points on the surface one point
near the center. All points are in the same sketch. I need to create an extrude
cut along the line between each of these surface points and the center point.
This will result in roughly 300 holes in the skull.”

 I was not provided with a skull model, so I simply used a sphere as I tested
the code that I wrote. Let’s see how I wrote it…

3
Feedback
 Your code worked perfectly! I tweaked it a bit and then seamlessly
combined it
with what I already had completed. Thank you so much for your support! Your
© Dassault Systèmes | Confidential Information | 2/16/2021 | ref.: 3DS_Document_2020

quick email responses in addition to your comprehensive videos have been


invaluable.

 CADSharp.com offers over 20 hours of video training, dozens of written guides,


over 400 example macros, and on-demand technical support via Slack.

 Questions?

You might also like