What do you do in the morning when you have a hankering for a fried doughy foods and a massive glass of SolidWorks API knowledge? Stop by your nearest doughnut shop? Unfortunately, they know nothing of SolidWorks API and you may not get your doughnuts if you mention anything of it. So, after you’ve grabbed a bag of bearclaws, head over to CADSharp.com and absorb the frothy goodness of video tutorials and everything you’ve ever wanted to know about creating custom programs for SolidWorks.
SolidWorks API Tutorials
CADSharp is the brainchild of Keith Rice, a former SolidWorks application support engineer. He started it because the lack of information for learning the SolidWorks API drove him crazy. Having used VB since 2001, he wanted to tie his knowledge into the SolidWorks API and there were no resources laying it out in a simple visual way for beginners. CADSharp does exactly that. You can check out their massive Macro library and Video library, with many free examples and sign-up to become a member for additional videos and support. The CADSharp blog is also a great source of information with the occasional SolidWorks tip and API insight.
Having programmed and used many macros and custom programs for SolidWorks, I wanted to find out more from Keith about CADSharp and what he sees as the biggest benefit for SolidWorks user who want to become more proficient with the SolidWorks API.
1. What is the most significant way a company could extend their SolidWorks installation?
Most companies could benefit from automating some part of their engineering workflow. Sometimes that need is met through an add-in, but much of the time a more custom solution is necessary. Maybe that need is automated model creation. Maybe it is replacing title block data in thousands of legacy drawings. Maybe it is extracting detailed information about every assembly weldment member to store in a spreadsheet. Regardless, the SolidWorks Application Programming Interface (API) makes that solution possible. The bottom-line savings can be tremendous, but the lack of beginner-friendly training resources has turned the API into an untouchable treasure chest for many engineers. So their macros may never move beyond pasted-together code that saves a few mouse clicks each day. I think it’s really unfortunate. If there is one part of SolidWorks that is vastly underused in proportion to its power, it is the API.
2. How can APIs be used to integrate other systems with SolidWorks? What are the possibilities?
APIs are essential for modeling package integration via add-ins, whether exchanging geometry or feature tree data. As for why we haven’t seen more interoperability through add-ins, I think this is more due to kernel limitations and proprietary formats, not SolidWorks Corporation’s unwillingness to expose certain API calls. Consequently, I doubt any revolutionary advancement in integration will be caused by new uses of the existing API. The pinnacle of integration may look like whatever IntegrityWare accomplishes in the near future with Power SubD-NURBS, now that tsElements for SolidWorks has probably plateaued. Beyond that, eyes look anxiously toward new possibilities in the shadowy “SolidWorks V6”.
3. What tips do you have for aspiring SolidWorks API programmers?
First, unless you have a strong programming background, learn the API with VBA (Visual Basic for Applications) macros first. Leave VB.NET or C# for down the road, otherwise the steeper learning curve may burn you out before you taste what it’s like to harness the power of the API. Second, learn how to use the API Help well, especially in conjunction with the SolidWorks Object Model. Those who rely on the macro recorder or pasting code from other macros hit a ceiling real fast – and a very low ceiling at that. Third, persist. Show me a good API programmer and I’ll show you someone who relishes in the small victories, someone who doesn’t throw in the towel when they hit new obstacles. Stick with it, because it keeps getting easier, and the end result is nothing short of awesome.
Thanks Keith. To get your API chops up to snuff, stop by Keith’s website, CADSharp.com to start learning.