SolidWorks AI Assistant is an in-process SolidWorks add-in that gives you a chat-based assistant inside the SolidWorks task pane. It can inspect the current model, create sketches and features, change dimensions, and export files through the SolidWorks API.
This repo is aimed at a practical workflow, not a demo-only mockup:
- the add-in runs inside SolidWorks
- the LLM layer is provider-agnostic
- OpenAI and Anthropic are both supported
- mutating actions require human approval before execution
If you want the full system view, start with ARCHITECTURE.md.
What is already in place:
- provider-neutral orchestration layer
- OpenAI and Anthropic adapters
- shared tool definitions across providers
- per-provider encrypted API-key storage
- per-action approval for model-changing and file-writing tools
- session reset when the active SolidWorks document changes
What this means in practice:
- read-only questions can run directly
- geometry creation and export actions stop for confirmation
- the same UI can talk to different model providers
Read-only operations:
- inspect the active document
- list features
- inspect dimensions
- get mass properties
- change view orientation and zoom
Mutating operations:
- create a new part or assembly
- create sketches on the standard planes
- add sketch lines, circles, arcs, and rectangles
- extrude, cut-extrude, revolve, fillet, and chamfer
- change named dimensions
- save and export STEP files
At a high level, the flow is:
TaskPane UI -> AgentSessionOrchestrator -> ModelProviderRegistry -> OpenAI or Anthropic provider -> SwToolExecutor -> SolidWorks COM API The task pane collects your prompt. The orchestrator keeps the structured conversation and decides when tools should run. The provider adapter translates that conversation to the selected LLM API. Tool calls are routed back into the executor, which marshals execution onto the SolidWorks STA thread.
The add-in does not auto-run all CAD changes.
- Read-only tools run immediately.
- Sketch, feature, dimension, create, save, and export tools require approval.
- If you reject a tool call, the model is told that the action was rejected.
- If the active SolidWorks document changes, the AI session is reset so stale context is not reused.
- If the model loop becomes incomplete or runs too long, the add-in surfaces an explicit error instead of silently returning a partial answer.
OpenAI:
- default model:
gpt-5.4 - presets:
gpt-5.4-mini,gpt-4.1
Anthropic:
- default model:
claude-sonnet-4-6 - presets:
claude-opus-4-6,claude-haiku-4-5-20251001
This project targets .NET Framework 4.8 and uses local SolidWorks interop DLLs.
Basic install flow:
- Open ClaudeSW.sln in Visual Studio 2022.
- Make sure the
.NET Framework 4.8 targeting packis installed. - Restore
Newtonsoft.Json. - Build
Release | x64. - If automatic COM registration does not succeed, register the output DLL with
RegAsm.exe. - Open SolidWorks and enable
SolidWorks AI AssistantinTools -> Add-Ins.
The project file already points at the standard SolidWorks interop folder on this machine layout:
C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\api\redist\
- Open the task pane.
- Open
Settings. - Select a provider.
- Select a model for that provider.
- Paste the provider-specific API key.
- Click
Validate & Save.
API keys are encrypted with Windows DPAPI and stored under %APPDATA%\ClaudeSW.
The tool surface was intentionally narrowed to match the current executor implementation.
sw_extrudesupportsone_directionandboth_directionssw_revolvedoes not expose an explicit axis argument yetsw_filletandsw_chamferwork on currently selected edgessw_new_partdoes not expose unit-system switching yetsw_create_sketchis limited toFront,Top, andRight
The project is usable, but it is not finished. The main items still pending are:
- stronger SolidWorks typing instead of relying so heavily on
dynamic - integration testing on a real SolidWorks workstation
- better entity-selection tools for faces, edges, and named references
- grouped approvals for multi-step operations instead of one dialog per action
- undo-group support for a full agent action sequence
- better assembly-specific operations, mates, and drawing support
- richer provider settings and model capability handling
- stronger packaging and installation flow for non-developer users
- Integration testing on a live SolidWorks workstation is pending.
- The codebase compiles and the architecture is complete; execution-layer validation is the remaining step.
- ARCHITECTURE.md: product flow and communication diagrams
- ClaudeSwAddin.cs: add-in entry point and provider bootstrap
- Api/AgentSessionOrchestrator.cs: shared agent loop and session state
- Api/OpenAIModelProvider.cs: OpenAI adapter
- Api/AnthropicClient.cs: Anthropic adapter
- Tools/SwToolExecutor.cs: SolidWorks tool execution
- UI/ChatTaskPane.cs: task pane and approval UI
This project is licensed under the MIT License.