NEW: SOLIDWORKS API Best Practices Guide

Blog 3.17.2020 No Comments

(Important: This guide is owned and distributed by SOLIDWORKS Corp, not CADSharp LLC, which is why we cannot provide it to you directly.)

When SOLIDWORKS Corporation needed a best practices document written for the SOLIDWORKS API, they came to CADSharp LLC. That’s why we’re extremely proud to present “SolidPractices: Getting Started with the SOLIDWORKS API”, a detailed, 36-page SOLIDWORKS API best practices guide written by our Technical Director, Keith Rice, and born out of nearly a decade of real-world, customer-driven SOLIDWORKS API development. Below is the table of contents:

1. Preface
2. Introduction
3. Programming Best Practices
        1. Separation of Concerns
4. Program Type and Language Comparison
        1. Choosing A Program Type and Language
5. The Macro Recorder
7. The SOLIDWORKS API Object Model
8. General SOLIDWORKS API Usage Advice
        1. Version Interoperability
        2. Naming SOLIDWORKS Variables
        3. Early Binding SOLIDWORKS API Object Variables
        4. Optional Arguments
        5. Common Pitfalls
        6. Troubleshooting API Calls
9. General .NET Development Best Practices
        1. Installers
        2. Versioning
        3. Assembly Information
        4. Primary Interoperability Assemblies (PIAs)
        5. Source Control
        6. Embed Interop Types
        7. Error Handling and Program Termination
        8. Logging
        9. Remembering User Inputs
        10. Message and Dialog Boxes
        11. About Boxes and Help Pages
        12. XML Comments
10. Addin Development Best Practices
        1. Exposing the ISldWorks Pointer
        2. COM Visibility
        3. Addin Registration
        4. Tools Suite Addins
        5. Debugging Addins
        6. Updating Addins
        7. Architecting Addins
11. Stand-Alone Development Best Practices
        1. Getting the ISldWorks Pointer
        2. Testing If SOLIDWORKS Crashed
        3. Calling An Addin From A Stand-Alone
12. Addin User Interfaces
        1. User Interfaces
        2. Launching User Interfaces
13. Stand-Alone User Interfaces

How To Get Your Copy

The guide is only available to those with a SOLIDWORKS subscription. If you do not have a subscription, please contact your Value-Added Reseller to become a subscriber, which provides you full-access to the SOLIDWORKS Customer Portal so that you can find the guide in the Knowledge Base under S-077636. Here is a direct link to the guide’s solution page, which will ask you to log in to

Have any questions or comments? We’d love to hear them.

If you want to keep up-to-date with quality content like this, don’t hesitate to sign up for our newsletter!

Leave Comment

Deep Discount: 3-Month Membership For $99

Blog 3.17.2020 No Comments

UPDATE: This coupon expired on May 31, 2020.

We live in interesting times. Our regards go out to all of those who are affected by COVID-19. Indeed, our main office is located in Washington state, where most US-based COVID cases have occurred. Fortunately, almost everyone at CADSharp works remotely so you should see no change to how you do business with us.

Given the disruption to many peoples’ work and the general economic turmoil, we hope that our three-month access to’s power user membership for only 99 USD will provide value to you during this time. This is the deepest discount we’ve ever offered with a membership. It does NOT include technical support access, but you will still have access to ALL of our online content at

Originally this discount was intended to be only for potential customers in nations with bad conversion rates against the US dollar. We know this has prevented many people from affording a membership in the past who might have liked to use our training. Given the current economic turmoil, however, we decided to extend the discount to all users.

How To Get the Discount

If already registered at

  1. Log into
  2. Go to the Videos page
  3. Click Upgrade in the Member’s Area on the right
  4. Choose 3-month membership
  5. Enter the coupon code “learnapi”
  6. Proceed with payment

If not yet registered at

  1. Go to our Memberships page
  2. Enter your user name and email
  3. Choose 3-month membership
  4. Enter the coupon code “learnapi”
  5. Proceed with payment

Want to stay current with offers like this and more? Sign up for our newsletter!

Stay safe and keep learning!

Leave Comment

Block Commands With the SOLIDWORKS API

Blog 3.2.2020 No Comments

CADSharp is pleased to present a new free tool called Command Blocker that blocks specific commands from running in SOLIDWORKS. Optionally, you can also run a macro in lieu of the default behavior, effectively overriding the command with your own custom functionality. This tool might be used by both users and CAD admins to prevent intentionally or accidentally using certain commands:

<> Custom property dialog

<> Addin dialog

<> Copy to Adobe Illustrator

<> Edit title block

As demonstrated in the video above, this is made possible by listening for the values of commands and then entering them in a settings dialog. This means that any command in SOLIDWORKS can be blocked — use with caution!


Download the Command Blocker installer here.

How It Works

The secret sauce to this addin isn’t a secret for anyone who has taken one of CADSharp’s Advanced Program Development Using .NET training course. If you haven’t taken that class, I’ll still let you in on the secret: CommandOpenPreNotify event. By listening for this event, you can cancel the default the behavior and replace it with your own. You can see a open source example of such a listener here. The class containing the event listener is shown below:

The Next Level

If you can envision this tool being useful for your organization in some modified form then please reach out to us to discuss your needs. For example, if this were to be used by a CAD administrator then additional features might include:

1. Preventing users from accessing the Settings dialog

2. Allowing the Settings dialog to import blocked commands from a list kept on a server.

Reach out to us if you’re ready to take Command Blocker to the next level. Until then, thanks for checking out this tool and don’t forget to sign up for our newsletter below so you can learn about more products like this.

Leave Comment