CAD Software Guides

SOLIDWORKS API Development and Design Automation

SOLIDWORKS has millions of users and a mature API. For machine builders and product companies, it is one of the most rewarding platforms to automate.

Ways to automate SOLIDWORKS

OptionLanguageBest for
MacrosVBA, VB.NET, C#Personal or team utilities
Add-insC#, VB.NET, C++Professional tools with task panes and menus
Stand-alone appsC# / VB.NETBatch processing and configurators
Document Manager APIC# / VB.NETRead and write properties without opening SOLIDWORKS (licence key required)
SOLIDWORKS PDM APIC# / VB.NETVault events, tasks and data cards
DriveWorks / design tablesNo code / rulesRule-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.

EM
ENGIMANDI CAD Team

We build CAD add-ins, automation and integrations for engineering and manufacturing companies worldwide.