SolidWorks-CLI

SolidWorks-CLI vs writing C# against the SOLIDWORKS COM API

Automating SOLIDWORKS directly means writing C# against version-specific COM interop DLLs for every task, while the alternative is repeating clicks in the viewport. SolidWorks-CLI implements the COM plumbing once via late binding: 92 verbs with plain flags, JSON output, persistent face/edge handles and dry-run safety until --apply.

92 verbs · Single late-bound COM binary · 10 tasks compared below

TaskSOLIDWORKS GUI, by handRaw C# COM API SolidWorks-CLI
Inspect a part's feature tree and dimensionsOpen the part and expand every FeatureManager folder by handAttach via ROT, traverse IFeature.GetFirstFeature / GetNextFeature and IDisplayDimension in COMsolid tree, solid features, solid part-dims as JSON
Target a face or edge reliably after editsRotate the model and click the face in the viewport againCall GetPersistReference3 / GetObjectByPersistReference3, serialize byte arrays and check stale refssolid refs-list / solid refs-of with persistent @fN handles
Create a dimensioned 2D sketch and extrude or cutPick a plane, draw segments, add relations and dims, run Extrude/CutCoordinate InsertSketch2, CreateLine, SketchAddConstraints and 23-argument FeatureExtrusion3solid sketch, solid extrude, solid cut
Add fillets, chamfers, shells or patternsSelect edges or faces manually and fill each PropertyManagerSelect objects with exact marks, manage IFeatureData, AccessSelections and ReleaseSelectionAccesssolid fillet, solid chamfer, solid shell, solid linear-pattern
Insert assembly components and create matesInsert each part, drag near position, pick faces in the Mate dialogCall AddComponent5, compute transform matrices, invoke AddMate5 with exact alignment enumssolid insert-component, solid mate, solid move-component
Audit an assembly for interference, mass and BOMRun Interference Detection, Mass Properties and BOM tables separatelyDrive IInterferenceDetectionMgr, walk leaf components and aggregate mass/material datasolid review, solid interference, solid mass-props, solid bom
Create a 3-view drawing and export STEP / PDF / DXFOpen template, place views, add dimensions and Save As per formatHandle drawing templates, Create3rdAngleViews2, IExportPdfData and Extension.SaveAssolid new-drawing, solid drawing-view, solid drawing-dim, solid export
Preview edits before touching production CADNo dry run: edits alter the open model immediatelyOnly if you build your own sandbox copy and rollback harnessEvery write verb is a dry run until --apply, guarded by solid sandbox and policy.json
Run across SOLIDWORKS versions without licensed DLLsOperate each local installation manuallyReference local SolidWorks.Interop.*.dll assemblies and recompile per versionSingle x64 late-bound COM binary, zero SOLIDWORKS DLLs redistributed, ROT attach (--pid)
Keep concurrent callers from corrupting a sessionOne engineer per windowBuild your own cross-process lock: SOLIDWORKS COM is single-threaded and synchronousMachine-wide Ring-1 mutex refuses concurrent writes cleanly, plus solid batch for one-attach runs

The repetitive cost in raw C# is the plumbing: ROT session discovery, late-bound dispatch, persistent reference serialization, rebuild verification and cross-process locking. Paying that once in one CLI gives every script and AI agent a uniform JSON surface.

Common questions

Do I need to write C# to automate SOLIDWORKS?

Not with a command-line layer in front of the COM API. SolidWorks-CLI wraps the ROT attach, persistent geometry references, dry-run guards and rebuild checks once, exposing 92 JSON verbs usable from PowerShell, Python, CI scripts or AI agents.

Does SolidWorks-CLI replace a SOLIDWORKS license?

No. It automates the licensed SOLIDWORKS installation already on your Windows workstation through its public COM API. What it replaces is manual clicking and repetitive per-task C# boilerplate.

Run these verbs on your own SOLIDWORKS models

Run read-only inspection on any part or assembly before changing a single millimetre. SolidWorks-CLI is local and on-premise: zero UAC elevation, zero SOLIDWORKS interop DLLs redistributed, and every write is a dry run until you pass --apply. Fourteen-day free trial with corporate e-mail, no card.

Start a 14-day free trial

Verb families