Learn SOLIDWORKS-ADDINS with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
VBA Macro Hello World
Dim swApp As Object
Sub main()
Set swApp = Application.SldWorks
swApp.SendMsgToUser "Hello World from SolidWorks VBA!"
End Sub
A SolidWorks VBA macro that prints 'Hello World' in the CAD status bar.
2
C# Add-in Example
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using System;
public class HelloWorldAddIn
{
public void ConnectToSW()
{
SldWorks swApp = new SldWorks();
Console.WriteLine("Hello World from SolidWorks C# Add-in!");
}
}
A SolidWorks C# add-in that connects to SolidWorks and writes a message to the console.