Fornax

Tehisaru joonestuslaua taga: Claude juhib DraftSighti ja Fusionit

AI at the drawing board: Claude driving DraftSight and Fusion

11.2026 · lugemisaeg ~6 minNov 2026 · ~6 min read

Tahtsin teada, kas keelemudel suudab päriselt CAD-programmi juhtida: joonistada, mõõta ja mudelit üles ehitada. Proovisin kahte teed: DraftSighti jaoks ehitasin ise C#-is vahelüli, Fusionis on see juba sisse ehitatud. Mõlemad töötasid. Huvitavam oli aga aru saada, milleks see tegelikult sobib ja milleks mitte.

I wanted to know whether a language model can really drive a CAD program: draw, measure and build up a model. I tried two routes — for DraftSight I built my own C# bridge, in Fusion it is built in. Both worked. The more interesting part was understanding what it is actually good for, and what not.

Kaks teed

Two routes

MCP (Model Context Protocol) on viis, kuidas keelemudel saab teise programmi tööriistu kasutada. CAD-programmi puhul tähendab see, et mudel saab joonistada, mõõta ja joonist lugeda. Tavalise eestikeelse käsu taga on päris API-kutsed.

MCP (Model Context Protocol) is how a language model uses another program’s tools. For a CAD program it means the model can draw, measure and read the drawing — behind a plain-language request are real API calls.

A · DraftSight: oma vahelüliA · DraftSight: your own bridge üks arvutione PC ClaudeClaude Desktop / CodeDesktop / Code stdiostdio MCP-serverMCP server C#, .NET · oma koodC#, .NET · your code COMCOM DraftSightDraftSight API: dsAutomation (APISDK)API: dsAutomation (APISDK) B · Fusion: MCP on juba seesB · Fusion: MCP is built in üks arvutione PC ClaudeClaude DesktopDesktop localhostlocalhost Fusioni MCP-serverFusion MCP server sisseehitatudbuilt in Python APIPython API FusionFusion mudel, joonised, ekraanipildidmodel, drawings, screenshots
A: DraftSighti jaoks on vaja oma vahelüli, mis räägib programmiga COM-i kaudu. B: Fusionis on kohalik MCP-server sisse ehitatud. Mõlemal juhul jääb kõik ühte arvutisse.
A: DraftSight needs your own bridge that talks to it over COM. B: Fusion has a local MCP server built in. In both cases everything stays on one PC.

DraftSight: C# API ja oma MCP-server

DraftSight: C# API and your own MCP server

DraftSightil on C# API, aga mitte igas paketis. Esimene samm on kontrollida, kas installatsioonis on kaust APISDK ja selles DraftSight.Interop.dsAutomation.dll. Kui seda pole, saab selle paigaldusprogrammist juurde lisada, kui litsents API-t lubab. Uuemates versioonides kuulub API ainult kallimatesse pakettidesse.

DraftSight has a C# API, but not in every edition. The first step is to check whether the installation has an APISDK folder with DraftSight.Interop.dsAutomation.dll. If not, it can be added from the installer when the licence includes the API. In current versions the API is only in the higher editions.

Esimene test võtab umbes 15 minutit: väike konsoolirakendus haagib end töötava DraftSighti külge ja joonistab joone ja ringi. Kui need joonisele ilmuvad, API töötab.

The first test takes about 15 minutes: a small console app attaches to the running DraftSight and draws a line and a circle. If they appear in the drawing, the API works.

// esimene test: kas API töötab? (.NET Framework 4.8, viide dsAutomation.dll-ile)
var app = (Application)Marshal.GetActiveObject("DraftSight.Application");
app.AbortRunningCommand();

SketchManager sm = app.GetActiveDocument().GetModel().GetSketchManager();
sm.InsertLine(0, 0, 0, 1000, 2100, 0);   // mm
sm.InsertCircle(500, 1050, 0, 100);
// first test: does the API work? (.NET Framework 4.8, reference dsAutomation.dll)
var app = (Application)Marshal.GetActiveObject("DraftSight.Application");
app.AbortRunningCommand();

SketchManager sm = app.GetActiveDocument().GetModel().GetSketchManager();
sm.InsertLine(0, 0, 0, 1000, 2100, 0);   // mm
sm.InsertCircle(500, 1050, 0, 100);

Sealt edasi on MCP-server väike .NET-rakendus (NuGet-pakett ModelContextProtocol), mis annab Claude’ile tööriistad nagu „joonista joon“ või „loe aktiivse joonise andmed“ ja kutsub nende sees sama API-t. Proof of concept töötas: Claude joonistas DraftSightis tavalise käsu peale.

From there, the MCP server is a small .NET app (NuGet package ModelContextProtocol) that gives Claude tools like “draw a line” or “read the active drawing” and calls the same API inside them. The proof of concept worked: Claude drew in DraftSight from a plain request.

COM töötab ainult samas arvutis. MCP-server peab jooksma DraftSightiga samas masinas ja kõige lihtsam on, kui ka Claude töötab seal.

COM only works on the same machine. The MCP server has to run on the DraftSight PC — simplest if Claude runs there too.

Fusion: MCP on juba sees

Fusion: MCP is built in

Autodesk Fusionis on kohalik MCP-server sisse ehitatud: Preferences → General → API ja linnuke „Fusion MCP Server“. Server töötab ainult siis, kui Fusion on lahti, ja kuulab ainult oma arvutis (127.0.0.1), nii et mudelid masinast välja ei lähe. Fusioni API on Pythonis ja C++-is, C#-i seal pole.

Autodesk Fusion has a local MCP server built in: Preferences → General → API and tick “Fusion MCP Server”. It runs only while Fusion is open and listens only on the local machine (127.0.0.1), so models never leave the PC. Fusion’s API is Python and C++, not C#.

Sellega lasin Claude’il ehitada parameetrilise lengi tapiühenduse ja seejärel terve tuletõkkeukse mudeli koos hingede ja lukuga. Fusion tegi mudelist ka automaatse 2D-joonise. See andis hea ülevaate, aga tootmiseks sellest ei piisanud: puudusid konkreetsed mõõdud ja lõiked ning detailide nimekiri oli üldine.

With it, Claude built a parametric frame mortise-and-tenon joint and then a full fire-door model with hinges and lock. Fusion also generated an automatic 2D drawing. It gave a good overview, but was not enough for production: specific dimensions and sections were missing and the parts list was generic.

Katsetasin Fusion Personal litsentsiga, mis on mõeldud ainult mitteäriliseks kasutuseks. Tootmises on vaja kommertslitsentsi.

I tested with a Fusion Personal licence, which is for non-commercial use only. Production use needs a commercial licence.

Milleks see sobib ja milleks mitte

What it is good for — and what not

ÜlesanneSobib?Miks
Uue detaili või sõlme kiire prototüüpJahkirjeldad sõnadega, mudel on minutitega olemas
Furnituuri 3D-teegi ehitamineJahkorduv töö tootja mõõtude järgi
Tapi- ja liiteloogika kontroll enne programmeerimistJahgeomeetria vead tulevad välja enne koodi
Üksiku eritellimuse modelleerimineJahüks kord, aga palju detaile
Tellimuste joonised tootmisse automaatseltEivajab avatud töölauaprogrammi; serveris töötav oma kood on kindlam ja kiirem
Tootmiseks valmis tööjoonisedVeel mitteautomaatjoonistel puuduvad mõõdud, lõiked ja täpne detailide nimekiri
TaskFit?Why
Quick prototype of a new part or jointYesdescribe it in words, the model exists in minutes
Building a 3D hardware libraryYesrepetitive work from manufacturer dimensions
Checking joinery logic before coding itYesgeometry mistakes show up before the code
Modelling a one-off custom orderYesdone once, but with many parts
Automatic order drawings for productionNoneeds an open desktop app; your own server-side code is more reliable and faster
Production-ready shop drawingsNot yetautomatic drawings lack dimensions, sections and an exact parts list

CAD koos MCP-ga on hea assistent inimese kõrval, mitte tehas, mis toodab joonised ise. Masstootmise joonised genereerib endiselt oma kood serveris.

CAD with MCP is a good assistant next to a person, not a factory that produces drawings by itself. Production drawings at volume are still best generated by your own code on a server.

Õppetunnid

Lessons

Sarnane mure liinil?

A similar problem on your line?