A collection of .NET libraries for building SolidWorks add-ins and extensions.
| Package | Description | NuGet |
|---|---|---|
| Hymma.Solidworks.Interop | SolidWorks Interop library references | |
| Hymma.Solidworks.Extensions | Extension methods for SolidWorks API | |
| Hymma.Solidworks.Addins | Framework for native-looking SolidWorks add-ins | |
| Hymma.Solidworks.Addins.Fluent | Fluent API wrapper for building add-ins |
# For the fluent API (recommended)
Install-Package Hymma.Solidworks.Addins.Fluent
# Or for the base add-in framework
Install-Package Hymma.Solidworks.Addins
# For extension methods only
Install-Package Hymma.Solidworks.Extensionsusing Hymma.Solidworks.Addins.Fluent;
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using System.Runtime.InteropServices;
[Guid("YOUR-GUID-HERE")]
[ComVisible(true)]
public class MyAddin : AddinMaker
{
public override AddinUserInterface GetUserInterFace()
{
return new AddinUserInterface(this)
.AddCommandTab()
.WithTitle("My Tab")
.That()
.IsVisibleIn(swDocumentTypes_e.swDocPART, swDocumentTypes_e.swDocASSEMBLY)
.AddCommandGroup()
.WithTitle("My Commands")
.WithIcon(Resources.MyIcon)
.Has()
.Commands(cmds => cmds
.Command("Do Something")
.WithIcon(Resources.CommandIcon)
.OnClick(() => DoSomething())
.Command("Another Action")
.WithIcon(Resources.AnotherIcon)
.OnClick(() => AnotherAction()))
.SaveCommandGroup()
.SaveCommandTab();
}
private void DoSomething()
{
// Your code here
}
private void AnotherAction()
{
// Your code here
}
}using Hymma.Solidworks.Addins;
using SolidWorks.Interop.sldworks;
using System.Runtime.InteropServices;
[Guid("YOUR-GUID-HERE")]
[ComVisible(true)]
public class MyAddin : AddinBase
{
public override bool OnConnect()
{
// Initialize your add-in
return true;
}
public override bool OnDisconnect()
{
// Clean up resources
return true;
}
}| SolidWorks Version | .NET Framework | Status |
|---|---|---|
| 2021+ | 4.8 | ✅ Supported |
| 2019-2020 | 4.7.2+ | ✅ Supported |
| 2018 | 4.6.2+ | ✅ Supported |
| 2017 and earlier | 4.5.2+ |
Note: SolidWorks add-ins require .NET Framework (not .NET Core/.NET 5+) due to COM interop requirements.
This repo includes two sample add-ins to help you get started:
-
QRify - Built with
Hymma.Solidworks.Addins- Converts text to QR code and copies to clipboard
-
QRify+ - Built with
Hymma.Solidworks.Addins.Fluent- Converts custom property values to QR codes with suffix support
Both samples are free for commercial use and include .snk files for immediate building after cloning.
We welcome contributions! Please see our Contributing Guide for details.
MIT © 2021 HYMMA