Hymma.Solidworks.Addins
2018.3.7
Prefix Reserved
See the version list below for details.
Requires NuGet 2.5 or higher.
dotnet add package Hymma.Solidworks.Addins --version 2018.3.7
NuGet\Install-Package Hymma.Solidworks.Addins -Version 2018.3.7
<PackageReference Include="Hymma.Solidworks.Addins" Version="2018.3.7" />
<PackageVersion Include="Hymma.Solidworks.Addins" Version="2018.3.7" />
<PackageReference Include="Hymma.Solidworks.Addins" />
paket add Hymma.Solidworks.Addins --version 2018.3.7
#r "nuget: Hymma.Solidworks.Addins, 2018.3.7"
#:package Hymma.Solidworks.Addins@2018.3.7
#addin nuget:?package=Hymma.Solidworks.Addins&version=2018.3.7
#tool nuget:?package=Hymma.Solidworks.Addins&version=2018.3.7
Overview
Solidworks is knows to be easy to use. On the one hand, it is a feature-rich software that has a solution for most users requirements. On the other hand, it has a powerful UI to deliver those features. This package is focused on the UI side of things. It allows you create native looking addins for solidworks easily.
The Issue with Solidworks API
Solidworks API is well documented by Dassault Systems. But since it uses COM you should use primitive types like string to interact with it. For example there is no Bitmap object, you should format, resize and save the image following strict regulations and pass the file path to solidworks.
Fortunately Hymma.Solidworks.Addins wraps solidworks API functions in a proper object. To put it other words, it acts as a proxy between your code and solidworks API. It uses .NET Framework objects and events. In the example above, you would use a Bitmap object and the framework will format, resize and save the image and pass the address to solidworks.
Note
Hymma.Solidworks.Addinsuses%localappdata%as the main folder for saving and accessing files.
Addin UIs
Solidworks API names particular sections of the UI and we have stick to that naming convention. Below you can see some of the main (most used) UI elements in a Solidworks addin.
Terminology 😒
Command
It is a button in one of the menu bars or the tab bar. It sends a signal to Solidworks to start a Feature. Commands are housed in the Command Group which in turn is in a Tab and(or) Menu item.
Feature
When users create a 3D object, cut from it or modify it in any form they have used a feature.
Property Manager Page
Each feature in solidworks has its own Property Manager Page. A Property Manager Page hosts UI elements that allow users to define the feature. For example when user clicks on the Hole button a property manager page will pop up on the left side of the screen. And they define the diameter and depth of the Hole.
Quick Start
Create and register the addin
- In Visual Studio create a new
Class Librarytargeting.Net Framework 4.7.2or.NET Framework 4.8. You should run Visual Studio as Admin. - Rename
Class1to something meaningfull. (Optional) - Right-click on your project file >
Manage Nuget Packages> InstallHymma.Solidworks.Addins. Version starts with the version of solidworks. (i.e. nuget package version 2018.x.xxx targets solidworks version 2018 and newer) - Right-click on your project file > Properties > Debug > Start External Program >
C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\SLDWORKS.exe.(Or wherever your solidworks exe is located) - While in your project properties > Build > Check
Register For COM Interop> Platform TargetAny CPU - While in your project properties > Signing > from the drop down on the bottom (Choose a strong name key file) > New > Assign a name and ok
- Add below
Attrubutesto you main class
[Addin("Title_Of_Your_Addin", AddinIcon = "addin_icon.png (Or addin_icon if using resx)", Description = "Description_For_Addin", LoadAtStartup = true)]
[Guid("C69637E8-D32E-4C73-A3F6-5DB5DD70E0EF")]
[ComVisible(true)]
To Create a GUID go to
Toolsmenu inVisual StudioselectCreate Guidthen select the5thitem and press theCopy buttonand exit.
AddinIcon is the name of the image that is either marked as Embedded Resource or is added to your project using
Resourcessection of your project properties window. If you decided to use an embedded resource you must provide the extension otherwise just the name of the file will suffice. 6. Inherit fromAddinMaker>Ctrl+.on your class andImpliment abstract class
At this stage you could build your project and register the addin to COM. To confirm that >Win key + R > Regedit > browse to 'HKEY_LOCAL_MACHINE\SOFTWARE\SolidWorks\AddIns' and you should find a folder with named with the guid value you provided.
Alternatively you could run this code in powershell
dir -Path 'HKLM:\SOFTWARE\SolidWorks\AddIns'
Add UI elements to your addin
Once you implemented the abstract AddinMaker into your class, you can define the UI object in public override AddinUserInterface GetUserInterFace().
We strongly recommend you clone this repo and open the project and then browse to QRify project. This project uses the Hymma.Solidworks.Addins to make a sample addin. It is heavily commented and demostrates how UI elements are defined.
Additionally, we have created an SVG file of the PlantUML diagrams for all the types in this package. You can find instructions under the classDiagrams folder 📂 to eaither re-compile them or simply download the file.
Version 2018.3.2
There were some breaking changes in version 2018.3.2. Which were neccessary to fix memory leaks caused by events and Bitmaps. The event signatures have changed to (object sender, EventArgs e) and in some cases custom EventArgs is used.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Hymma.Solidworks.Interop (>= 2018.3.7)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Hymma.Solidworks.Addins:
| Package | Downloads |
|---|---|
|
Hymma.Solidworks.Addins.Fluent
Framework to create Addins for SOLIDWORKS 2018 and later using fluent API. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2018.3.9 | 189 | 6/12/2026 |
| 2018.3.8 | 169 | 4/9/2026 |
| 2018.3.7 | 250 | 2/13/2026 |
| 2018.3.6 | 159 | 2/6/2026 |
| 2018.3.5 | 686 | 12/11/2025 |
| 2018.3.4 | 564 | 12/7/2025 |
| 2018.3.3 | 404 | 12/7/2025 |
| 2018.3.2 | 330 | 12/7/2025 |
| 2018.2.3 | 343 | 7/25/2024 |
| 2018.2.2 | 326 | 7/24/2024 |
| 2018.2.1 | 332 | 7/22/2024 |
| 2018.2.0 | 347 | 7/22/2024 |
| 2018.1.9 | 343 | 7/22/2024 |
| 2018.1.8 | 346 | 6/28/2024 |
| 2018.1.7 | 337 | 6/21/2024 |
| 2018.1.6 | 316 | 6/10/2024 |
| 2018.1.5 | 334 | 6/3/2024 |
| 2018.1.4 | 344 | 5/3/2024 |
| 2018.1.3 | 328 | 5/1/2024 |
| 2018.1.2 | 351 | 4/20/2024 |
Fixed package to not include SolidWorks interop DLLs (use Hymma.Solidworks.Interop dependency instead)