Read-After-Write: Verifying AI-Driven Changes in SOLIDWORKS – Cloud CAD AI blog cover

Read-After-Write: Verifying AI-Driven Changes in SOLIDWORKS

Abstract. A language model that edits a CAD model can be wrong in ways that are easy to miss: a unit slip, a feature that failed to rebuild, a mate that was never applied. This article describes a read-after-write loop for AI-driven modeling in SOLIDWORKS through the Model Context Protocol. It covers unit normalisation, reading each tool result before the next step, batching known steps, and checking geometry with measured values rather than the model’s own description.

1. Introduction

Conversational CAD has an obvious appeal: describe the change, and the assistant makes it. The risk is equally obvious. A language model predicts plausible text, and “the extrude was created at 12 mm” is plausible whether or not it is true. In engineering, the measured state of the model is what counts, not the narrative around it.

The Model Context Protocol helps here because every tool call returns a structured result. The design question is how to make the assistant use those results. We describe the loop built into SOLIDWORKS MCP and its companion skills.

2. Method

2.1 Normalise units before the call

The SOLIDWORKS API works in SI units: lengths in metres and angles in radians. Engineers think in millimetres, inches and degrees. A request for “800 mm” must reach the API as 0.8.

Rather than trusting the model to remember this, the companion solidworks skill states the conversion rules explicitly: millimetres divide by 1000, centimetres by 100, inches multiply by 0.0254, feet by 0.3048, and angles go in radians. The engineer keeps asking in their own units, and the conversion happens once, in a documented place.

2.2 Read after every write

The loop is simple:

  1. Make one change.
  2. Read the tool result.
  3. Decide the next step from that result, not from the plan.

A result can report success, an error, or a refusal. In SOLIDWORKS MCP, a refusal or a confirmation_required result means the change did not run. The skill tells the assistant to treat it that way instead of continuing as if it had.

2.3 Batch only what is already known

Reading after every call is safe but slow. When the next several steps are fully determined (for example, a sketch followed by an extrude of that sketch), the assistant can send them together with a batch call, where a later step can refer to a handle produced by an earlier one. If the batch stops early, the assistant continues from the step that failed. Steps that depend on seeing a result, such as an API lookup or an inspection, stay as single calls.

2.4 Verify with measurements

After a major feature, the assistant checks the model with tools that measure rather than describe:

  • Mass properties for mass, volume and centre of mass.
  • Feature errors and What’s Wrong for rebuild problems.
  • Interference detection for assemblies.
  • A captured view of the model, taken once per answer.

The assistant then quotes feature names and numbers from those results. A claim such as “mass is 0.42 kg” should be traceable to a specific tool output.

2.5 Look up the API before calling it

SOLIDWORKS has a large API with many overloads and integer flags. For less common operations, the companion solidworks-api skill has the assistant search the API, read the member’s signature, and consult the help only when the signature is ambiguous. A call that needs a macro waits until the user agrees.

3. Discussion

The loop trades speed for traceability. Each check adds a tool call, and for simple parts an experienced engineer will often be faster by hand. The benefit appears in two places: repetitive edits across many features, and inspection tasks (mass, interference, BOM) where the assistant reads the model and reports figures without changing anything.

Two limits remain. First, verification can only check what a tool can measure: design intent, such as whether a hole should be there, still needs an engineer. Second, very large assemblies can produce results too large to return in one piece. The skill directs the assistant to narrower queries in that case.

Control over writes is a separate layer. SOLIDWORKS MCP installs with writes running directly. Setting the write policy to approve adds a Yes/No dialog before every change, and read-only blocks writes entirely (settings).

4. Conclusion

An AI assistant becomes useful in CAD when its claims are tied to the model’s measured state. Normalising units in one place, reading each result before acting again, batching only determined steps, and verifying with mass, error and interference checks turn a plausible narrative into an auditable sequence of changes.

Further reading on this site: Local vs remote MCP servers for desktop CAD · our products · engineering services · contact us · SOLIDWORKS MCP on Product Hunt

Get SOLIDWORKS MCP at solidworksmcp.com

References

  1. Cloud CAD AI. “SolidWorks MCP: Examples.” github.com
  2. Cloud CAD AI. “Companion skill: solidworks.” github.com
  3. Model Context Protocol. “Architecture overview: tools.” modelcontextprotocol.io
Shopping Cart