Ways to automate SOLIDWORKS
| Option | Language | Best for |
|---|---|---|
| Macros | VBA, VB.NET, C# | Personal or team utilities |
| Add-ins | C#, VB.NET, C++ | Professional tools with task panes and menus |
| Stand-alone apps | C# / VB.NET | Batch processing and configurators |
| Document Manager API | C# / VB.NET | Read and write properties without opening SOLIDWORKS (licence key required) |
| SOLIDWORKS PDM API | C# / VB.NET | Vault events, tasks and data cards |
| DriveWorks / design tables | No code / rules | Rule-based configuration |
What can be automated
- Parametric parts and assemblies from dimensions or tables.
- Configurations: create, rename and set properties in bulk.
- Drawings: views, dimensions, BOM tables, balloons, sheet formats.
- Custom properties: fill, validate and synchronise.
- Exports: PDF, DXF (flat patterns), STEP, eDrawings in batch.
- Weldments and cut lists; sheet metal flat patterns.
Example: export all sheet metal flat patterns
// C#: export flat pattern DXF for a sheet metal part (simplified)
var part = (PartDoc)swApp.OpenDoc6(path, (int)swDocumentTypes_e.swDocPART,
(int)swOpenDocOptions_e.swOpenDocOptions_Silent, "", ref err, ref warn);
string dxf = Path.ChangeExtension(path, ".dxf");
part.ExportToDWG2(dxf, path, (int)swExportToDWG_e.swExportToDWG_ExportSheetMetal,
true, null, false, false, 1, null); // 1 = include flat pattern geometry
swApp.CloseDoc(path);
Document Manager API
For tasks like reading properties or BOM structures across thousands of files, the Document Manager API is much faster than opening each file in SOLIDWORKS, and it doesn't need a SOLIDWORKS seat on the processing machine.
PDM integration
SOLIDWORKS PDM add-ins react to check-in and workflow transitions to validate data, generate outputs and send BOMs to ERP.
Macros are a great start; add-ins make automation part of every engineer's daily work.
SOLIDWORKS development with ENGIMANDI
See SolidWorks customisation, CAD to PDM integration and sheet metal DXF automation.