From Design Engineer to AI Engineer in CAD
A stage-by-stage technical roadmap for design engineers moving into AI: C#, the CAD API, Python, LLM APIs, embeddings, RAG and agents, with one project per stage.
The technical roadmap: CAD API, C#, Python, LLM APIs, embeddings, RAG, and agents.
Most AI-in-CAD roadmaps start with prompts. This one starts where the work actually happens: the CAD API. Every useful AI feature in CAD ends in an API call that changes a model, a drawing, or a record.
The stack has two halves. C# talks to CAD. Python talks to AI. JSON and a small local API connect them. Every stage below builds one piece of that stack, with concrete steps and one project you can show.
The stack you are building
- CAD layer (C#): SolidWorks API, add-in, Model to JSON extractor, rule checker (Stages 1 and 2)
- Bridge: JSON files, FastAPI service, local HTTP endpoint in the add-in (Stages 2 and 3)
- Model layer (Python): LLM API calls, structured output, pydantic validation (Stage 4)
- Knowledge layer: Embeddings, vector store, hybrid search, RAG with citations (Stages 5 and 6)
- Agent layer: Tool calling, MCP server, approvals, logs (Stage 7)
- Production: Evals, tracing, cost caps, privacy, deployment (Stage 8)
The model decides what to do. Your deterministic C# code does the engineering. Every AI output passes a schema and one of your rules before it touches a model or drawing.
Stage 0: Engineering foundation (1 to 2 weeks)
You already own this. It is the data and the rules every later stage runs on.
Learn
Design intent and parametric logic. Your team's drawing standards, templates, custom property names, revision scheme, and folder structure.
Do this, in order
- List every custom property your templates use and who fills each one.
- Write 10 rules your team applies by habit as if/then statements (for example: if sheet metal, then thickness property is required).
- Collect your standards PDFs and 20 real questions engineers ask about them. You will reuse both in Stages 5 and 6.
Project: A one-page rule sheet plus a folder of standards and sample parts.
Done when: Your team's drawing rules exist as plain if/then statements, not just in people's heads.
Stage 1: C# fundamentals (3 to 4 weeks)
SolidWorks, Inventor, AutoCAD, and Revit APIs are all built for .NET. C# is the most direct way in.
Learn
Visual Studio 2022. .NET Framework 4.8 (most CAD add-ins) and modern .NET. Types, classes, interfaces, List, Dictionary, LINQ, exceptions, try/finally. JSON with System.Text.Json or Newtonsoft.Json. NuGet. The debugger: breakpoints, watch, call stack.
Do this, in order
- Build a console app that reads a BOM CSV into a
ListofBomLineobjects. - Validate part numbers with Regex and print every failure with its row number.
- Group and count by material with LINQ.
- Write the results to a JSON file.
- Step through it in the debugger until you can explain every variable.
Project: A BOM validator console app that outputs a JSON report.
Done when: You can write a class, a loop, and a LINQ query without copying.
Stage 2: CAD API with C# (6 to 8 weeks)
This is the layer AI will eventually drive. If you cannot write these calls, an AI agent has nothing to call.
Learn
COM interop references (SolidWorks.Interop.sldworks, swconst). The object model: SldWorks, ModelDoc2, ModelDocExtension, CustomPropertyManager, FeatureManager, SelectionMgr, DrawingDoc, Sheet, View. The API help and recorded macros as your map. Same pattern elsewhere: Inventor.Application, AutoCAD .NET (Database, Transaction), Revit API (FilteredElementCollector).
Do this, in order
- Connect to a running SolidWorks session and print the active document title.
- Open files with
OpenDoc6. Read and write custom properties withCustomPropertyManagerGet6andAdd3. - Walk the feature tree with
FirstFeatureandGetNextFeature. Read dimensions withParameter("D1@Sketch1"). - Export drawings to PDF with
Extension.SaveAs. Read mass and volume withCreateMassProperty. - Package it as an add-in (
ISwAddin,ConnectToSW) with one ribbon button and a log file.
Project: Model to JSON extractor. For every part in a folder, write one JSON file with name, configurations, custom properties, material, mass, bounding box, and feature list. This JSON is your bridge to every AI stage.
Done when: You can extract 100 parts to JSON in one run and fix any COM error from the stack trace.
Stage 3: Python for AI (3 to 4 weeks)
LLM SDKs, embedding models, vector databases, and agent frameworks are Python-first. Keep C# for CAD, use Python for AI, and connect them with JSON or HTTP.
Learn
Python 3.11+, virtual environments (venv or uv), pip. Lists, dicts, functions, classes, pathlib, json. httpx or requests. pydantic for data validation. pandas for tables. FastAPI for small HTTP services. Jupyter for experiments. Optional: pywin32 to call SolidWorks COM from Python (fine for scripts, awkward with ref parameters, so keep heavy CAD work in C#).
Do this, in order
- Load every Stage 2 JSON file into a pandas DataFrame.
- Define a pydantic
Partmodel and reject files that fail validation. - Report inconsistencies: one material spelled three ways, missing part numbers, mass outliers.
- Serve the data with FastAPI:
GET /parts?material=S355.
Project: A parts data service in FastAPI over your extracted CAD data.
Done when: A teammate can query your CAD data from a browser without opening CAD.
Stage 4: LLM APIs (3 to 4 weeks)
Before RAG or agents, learn what one model call costs, what it returns, and how it fails.
Learn
Messages (system, user, assistant). Tokens, context window, temperature, cost per token. Streaming, retries, rate limits. Structured output with JSON schema or pydantic models. Few-shot prompts. SDKs: anthropic, openai. Local models with Ollama when CAD data cannot leave the building.
Do this, in order
- Get an API key and send your first message from Python.
- Ask for JSON output, validate it with pydantic, and retry on failure.
- Build a few-shot prompt from 5 real examples out of your own drawings.
- Log tokens and cost for every call.
- Run the same prompt on a local model through Ollama and compare quality.
Project: Property normalizer. Send messy description and material fields, get clean JSON back (material code, finish, thickness), validated by pydantic and checked against your Stage 0 rules before anything is written back to CAD.
Done when: Every LLM output in your code passes a schema and a rule. Nothing raw gets trusted.
Stage 5: Embeddings and vector search (2 to 3 weeks)
LLMs do not know your standards, past designs, or API docs. Embeddings turn text into vectors so you can find the right content by meaning, not keywords.
Learn
What an embedding is. Cosine similarity. Chunking: split by heading, roughly 300 to 800 tokens, small overlap. Embedding models: text-embedding-3-small, Voyage, or open source sentence-transformers (bge-small). Vector stores: Chroma or FAISS to start, pgvector or Qdrant for production. Metadata on every chunk: source, page, revision.
Do this, in order
- Extract text from your standards PDFs and the CAD API help with PyMuPDF.
- Chunk by section and attach source and page metadata.
- Embed the chunks and store them in Chroma.
- Query "revision format for sheet metal drawings" and read the top 5 chunks by hand.
- Tune chunk size until the right clause lands in the top 3.
Project: Semantic search over your drawing standards and API documentation.
Done when: For your 20 real questions from Stage 0, the right chunk is in the top 3 at least 17 times.
Stage 6: RAG (3 to 4 weeks)
Retrieval-augmented generation puts the right chunks in front of the model so answers come from your standards, with citations.
Learn
The pipeline: ingest, chunk, embed, store, retrieve, rerank, prompt with context, answer with citations. Hybrid search (BM25 keyword plus vector), which matters for part numbers and API names. Reranking. Metadata filters. Saying "I don't know" when nothing relevant comes back. Scoring retrieval and answers separately. LlamaIndex or LangChain, but only after you have built it by hand.
Do this, in order
- Build the pipeline in plain Python first, no framework.
- Force citations: every answer names the source document and page.
- Add BM25 hybrid search so
OpenDoc6orPN-10432match exactly. - Write a 30-question test set with expected answers and score it after every change.
- Add a second index over part metadata from Stage 3: "find similar brackets, 3 mm, S355".
Project: A standards and parts assistant that answers with citations and refuses when unsure.
Done when: You track test-set scores and can label every wrong answer as a retrieval miss or a generation miss.
Stage 7: Tool calling and agents (4 to 6 weeks)
RAG answers questions. Agents take actions. This is where an LLM starts calling the C# code you wrote in Stage 2.
Learn
Tool calling: tools defined with JSON schema, the model requests a call, your code runs it, the result goes back. The agent loop and stop conditions. MCP (Model Context Protocol) servers to expose tools to any compatible client. Bridging Python to CAD: a C# add-in hosting a local HTTP endpoint or named pipe, or pywin32. State and memory. Frameworks later: LangGraph, OpenAI Agents SDK, Claude Agent SDK.
Do this, in order
- Write the agent loop by hand with two read-only tools:
get_properties(path)andsearch_standards(query). - Expose your Stage 2 extractor and checker as a local HTTP service and call it from Python.
- Wrap the tools in an MCP server (Python MCP SDK, FastMCP):
list_drawings,check_drawing,get_properties,search_standards. - Add write tools such as
set_propertyonly behind dry-run and human approval. - Add limits: max steps, timeouts, and a log of every tool call with its arguments.
Project: Release agent. "Check every drawing in this assembly, fix missing materials where the standard is unambiguous, list the rest for me." Nothing is written without your approval.
Done when: You can replay the log of any run and explain why each tool was called.
Stage 8: Evaluate, ship, go deeper (ongoing)
A demo works once. A tool works every Monday morning. The difference is measurement.
Learn
Evals: fixed test sets, regression runs, LLM-as-judge used carefully. Tracing with Langfuse or LangSmith. Cost and latency budgets. Data privacy: customer IP, on-prem or local models, access control. Deployment: FastAPI plus Docker, background jobs. Going deeper: B-Rep and kernels (OpenCascade, pythonOCC), code-generated CAD (CadQuery, build123d) for text-to-CAD, ML on geometry.
Do this, in order
- Run your Stage 6 and 7 test sets automatically on every change.
- Trace every LLM call and tool call.
- Set a cost cap per run and alert when it is exceeded.
- Pilot with three real users for two weeks and log every failure.
- Try one text-to-CAD experiment: the LLM writes CadQuery code for a simple bracket and you validate the geometry.
Project: A pilot your team uses on real work, with measured accuracy, time saved, and cost per run.
Done when: You can show the numbers, and show exactly where the AI stops and your rules take over.
Your toolkit at a glance
| Area | Tools |
|---|---|
| C# | Visual Studio 2022, .NET Framework 4.8, System.Text.Json or Newtonsoft.Json, NuGet |
| CAD API | SolidWorks API (sldworks and swconst interop), API Help, macro recorder. Inventor, AutoCAD .NET, Revit API |
| Python | uv or venv, pydantic, pandas, FastAPI, httpx, Jupyter, pywin32 |
| LLM APIs | anthropic and openai SDKs, Ollama for local models |
| Embeddings | text-embedding-3-small, Voyage, sentence-transformers (bge-small), PyMuPDF for PDF text |
| Vector store | Chroma or FAISS to start, pgvector or Qdrant for production |
| RAG | rank-bm25 for hybrid search, a reranker, LlamaIndex or LangChain after the hand-built version |
| Agents | MCP Python SDK (FastMCP), LangGraph, OpenAI Agents SDK, Claude Agent SDK |
| Production | Langfuse or LangSmith tracing, pytest for eval runs, Docker |
| Geometry | OpenCascade, pythonOCC, CadQuery, build123d |
Six traps that stall the climb
- Starting with agents. An agent with no CAD API underneath can only talk. Stage 2 is what gives it hands.
- Skipping the JSON bridge. If your CAD data is not extracted and structured, RAG and agents have nothing reliable to work with.
- Trusting raw LLM output. Every output passes a schema and a rule before it touches a model or drawing.
- Using a framework before building by hand. Build RAG and the agent loop in plain Python once. Then frameworks make sense.
- No test set. Without 30 real questions and expected answers you cannot tell if a change made things better or worse.
- Sending customer IP to a public API. Check what data may leave the building. Use local models where it cannot.
Your next action: open your SolidWorks API help, find CustomPropertyManager, and write the 10 lines of C# that print every custom property of the active part. That is Stage 2, step 2, and it is the first tool your future agent will call.
Stages 1 and 2 are where most engineers stall. ScriptedCAD Workbooks take you from your first C# line to a working SolidWorks add-in. Free tips and roadmaps keep coming on the ScriptedCAD WhatsApp channel.
Keep reading with a free account
The rest of this guide, plus every other resource, is free. We just need to know who you are.
One quick thing
Add your WhatsApp number to keep reading. We send new CAD automation resources there. Reply STOP any time.
One last step
Add your WhatsApp number and your download starts instantly.
We send new CAD automation resources to this number. Reply STOP any time.