CADSharp is pleased to announce that our industry-leading SOLIDWORKS API and SOLIDWORKS PDM API libraries are now available to CADSharp.com Power User members. This is the ultimate toolkit for those who want to speed up their .NET addin and stand-alone development by utilizing our hand-made library of commonly used functions and classes. Best of all, it’s regularly updated by CADSharp team members with great new functionality.

Demonstration

Possibly the best way to demonstrate the power of this toolset is to compare two addins, one that uses CADSharpTools and one that does not. These addins both accomplish the same thing: creating dropdown menus in SolidWorks that appear in particular document types and display message boxes when clicked.

You will notice that the example using CADSharpTools requires fewer imports, fewer classes, fewer lines of code (about a third less), and is much more readable. More importantly, you can imagine how much faster developing an addin is using CADSharpTools. You can set up your own template with CADSharpTools already utilized or quickly update old addins. You might even discover a better way to accomplish certain tasks using our toolset.

Functionality

Note: While this is complete list of classes, the descriptions do not state all functionality in each class.

Contains classes that let you easily create drop-down menus and CommandManager tabs (saving you possibly hundreds of lines of code), register and unregister your addin with SolidWorks, and perform “cleanup” when unloading the addin.

Contains functions that let you rename components, get a component’s instance, get a component’s name without the instance number, and create an array of unique components in the assembly.

Contains dozens of useful file extension and file filter constants.

Lets you input your Document Manager license key via the constructor and then easily work with a document’s custom properties, get a document’s configuration names, and more.

Provides flexible options for searching for and updating notes, getting a note’s position relative to the sheet margin, and locating views.

Lets you store a spreadsheet’s contents in a .NET DataTable, get worksheet and workbook pointers, create Excel visibly or invisibly, quit Excel, and determine if any Excel processes are active.

Lets you safely create, copy, delete, and rename files and folders in Windows. You can also determine if a file is read-only, verify its extension, verify whether a file name is legal, and read text files.

Lets you sort ListView controls in ascending or descending order, as well as create file and folder browsers that add the browsed location to a text box.

Lets you easily handle various aspects of logging, namely creating the log entries and accessing the log folder in the user’s AppData folder.

Performs various tasks related to two or more SolidWorks model types, including toggling graphics updating, creating named views, working with display states, creating a pack and go, and saving the model (Save or Save As) in any format.

Performs tasks related to parts, including getting IBody2 pointer given a body name, getting a body’s folder feature, and getting a body’s cut list feature.

Lets you create an instance of a SolidWorks (for use with a stand-alone) with the ability to specify the desired year if multiple installations are present, exit SolidWorks (for use with a stand-alone), determine if any SolidWorks processes are active, open a SolidWorks model, get a model’s document type from its file path, and get a list of all SolidWorks models of a particular type in a folder.

Lets you search geometry and topology, such as getting the length of an edge and getting the largest planar face in a body.

Lets you easily get the data from a project’s Assembly Information, display a message with the product name as the title, save out an embedded icon to the local disk and get its file path, convert an enumerator to string, and compare two values given a tolerance.

Lets you read read a specific XML node, update a specific XML node, and get a list of all material names in a SolidWorks material database.

How Can I Use It?

If you are a Power User member and wish to use CADSharpTools then you may visit our this page to learn how to obtain it. You can either download the DLL and add it as a reference to your project or you can copy and paste individual portions of the source code into your code. The documentation is available in the repository. You can also submit bug reports and enhancement requests using the repository’s built-in issue tracker. If you’re new to online repositories and have any questions, let us know.

Think of it as similar to our Macro Library, except 1) the entire codebase can be downloaded and referenced in a project, 2) the codebase is in .NET. As long as you kindly do not share the DLL or the code outside of your organization with individuals who aren’t CADSharp, the sky is the limit. (Note: it is fine to use the code in a project that you will sell to a customer. Please the entire Usage Agreement here.)

Want to keep up with future content and training events? Sign up for our newsletter.