<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mlight Lee</title>
    <description>The latest articles on DEV Community by Mlight Lee (@mlightcad).</description>
    <link>https://dev.to/mlightcad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4167692%2F6d2fa7a6-4722-443d-be32-6631daa92406.jpg</url>
      <title>DEV Community: Mlight Lee</title>
      <link>https://dev.to/mlightcad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mlightcad"/>
    <language>en</language>
    <item>
      <title>Letting AI Write Code Against Your Drawings: The mlightcad MCP Server</title>
      <dc:creator>Mlight Lee</dc:creator>
      <pubDate>Sun, 25 Oct 2026 09:18:59 +0000</pubDate>
      <link>https://dev.to/mlightcad/letting-ai-write-code-against-your-drawings-the-mlightcad-mcp-server-3e6e</link>
      <guid>https://dev.to/mlightcad/letting-ai-write-code-against-your-drawings-the-mlightcad-mcp-server-3e6e</guid>
      <description>&lt;h3&gt;
  
  
  Stop teaching AI 100 CAD tools. Give it a scripting API and let it figure things out.
&lt;/h3&gt;

&lt;p&gt;A few weeks ago, I published &lt;a href="https://dev.to/mlightcad/building-a-cad-agent-mcp-tools-or-let-ai-write-code-2nc4"&gt;Building a CAD Agent: MCP, Tools, or Let AI Write Code?&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The basic argument was simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For complex software like CAD, giving AI a scripting API is often better than giving it a shopping list of tools.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think about it.&lt;/p&gt;

&lt;p&gt;If you want an AI agent to work with a CAD drawing, you could give it tools like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;draw_line&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;draw_circle&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query_entities&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;set_entity_layer&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;delete_entity&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sounds reasonable, right?&lt;/p&gt;

&lt;p&gt;Until someone asks:&lt;/p&gt;

&lt;p&gt;"Find all circles near standard bolt-hole sizes, ignore reference layers, group them by component, flag unusual ones, and generate a report."&lt;/p&gt;

&lt;p&gt;Oops. Looks like we need another tool.&lt;/p&gt;

&lt;p&gt;And another.&lt;/p&gt;

&lt;p&gt;And another.&lt;/p&gt;

&lt;p&gt;At some point, your MCP server starts looking like a restaurant menu with 500 dishes. The AI is still hungry, and you're still adding pages.&lt;/p&gt;

&lt;p&gt;So we tried something different.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mlightcad/cad-viewer" rel="noopener noreferrer"&gt;mlightcad&lt;/a&gt;, our open-source browser-based CAD viewer, now supports the Model Context Protocol through &lt;code&gt;@mlightcad/cad-mcp-server&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Instead of exposing every CAD operation as a separate tool, we give the agent a scripting API and let it write JavaScript to perform the actual work.&lt;/p&gt;

&lt;p&gt;And then we tested it on three real drawing-processing tasks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Extracting a BOM from a table drawn entirely with lines and text.&lt;/li&gt;
&lt;li&gt;Extracting information from a drawing frame and title block.&lt;/li&gt;
&lt;li&gt;Splitting a drawing containing multiple framed sheets into independent DXF files.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All three worked.&lt;/p&gt;

&lt;p&gt;Let's see how.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz53c88qk6gsyoata74jp.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz53c88qk6gsyoata74jp.webp" alt="mlightcad mcp" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The architecture: One brain, multiple ways to use it
&lt;/h2&gt;

&lt;p&gt;The first thing we wanted to avoid was building three separate AI implementations.&lt;/p&gt;

&lt;p&gt;One for the in-app chat agent.&lt;/p&gt;

&lt;p&gt;One for MCP.&lt;/p&gt;

&lt;p&gt;And another one for whatever integration comes next.&lt;/p&gt;

&lt;p&gt;That would be a great way to create three bugs for every bug we fix.&lt;/p&gt;

&lt;p&gt;Instead, mlightcad uses a shared agent core.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwst6y0v9drd75b5ls0ef.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwst6y0v9drd75b5ls0ef.webp" alt="mlightcad agent architecture" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The architecture has three main parts.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;@mlightcad/cad-agent-core&lt;/code&gt; — The engine
&lt;/h3&gt;

&lt;p&gt;This is where the actual CAD intelligence lives.&lt;/p&gt;

&lt;p&gt;It provides two capabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. A scripting environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The agent can execute JavaScript against a live CAD drawing.&lt;/p&gt;

&lt;p&gt;The script receives a single argument:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cad&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Think of it as handing the AI a workbench.&lt;/p&gt;

&lt;p&gt;It can inspect the drawing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;drawing&lt;/span&gt;
&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;entities&lt;/span&gt;
&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tables&lt;/span&gt;
&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;blocks&lt;/span&gt;
&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selection&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It can measure geometry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;measure&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It can edit the drawing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;transaction&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it can save the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;saveDxf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, the agent can inspect entities, query layers, find objects inside a bounding box, measure distances, or modify geometry.&lt;/p&gt;

&lt;p&gt;It doesn't need a separate MCP tool for every operation.&lt;/p&gt;

&lt;p&gt;It just needs to know how to use the API.&lt;/p&gt;

&lt;p&gt;Of course, letting an AI execute arbitrary JavaScript inside a CAD application sounds like an excellent way to spend your weekend debugging security problems.&lt;/p&gt;

&lt;p&gt;So the scripts run inside a sandbox.&lt;/p&gt;

&lt;p&gt;The validator restricts the available API. Scripts cannot import arbitrary modules or access the browser page.&lt;/p&gt;

&lt;p&gt;The model gets access to the CAD workbench, not the entire house.&lt;/p&gt;

&lt;p&gt;The complete API is documented here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mlightcad.com/cad-viewer/docs/guide/script/api.html" rel="noopener noreferrer"&gt;mlightcad Script API&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. A tool interface&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The core also provides a tool catalog.&lt;/p&gt;

&lt;p&gt;Currently, it contains exactly one tool:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;execute_cad_script&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The script runs inside the CAD environment.&lt;/p&gt;

&lt;p&gt;If it produces a DXF file or a preview image, the core can attach those results to the tool response.&lt;/p&gt;

&lt;p&gt;The important detail is that the model doesn't need to receive the entire drawing or the complete contents of the exported file.&lt;/p&gt;

&lt;p&gt;It can receive a summary and file metadata instead.&lt;/p&gt;

&lt;p&gt;We'll come back to why that matters.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;@mlightcad/cad-agent-plugin&lt;/code&gt; — The in-app agent
&lt;/h3&gt;

&lt;p&gt;This is the agent users interact with inside &lt;a href="https://mlightcad.github.io/cad-viewer/" rel="noopener noreferrer"&gt;cad-viewer&lt;/a&gt; and cad-simple-viewer.&lt;/p&gt;

&lt;p&gt;It registers the &lt;code&gt;agent&lt;/code&gt; chat command and lets users describe drawing tasks in natural language.&lt;/p&gt;

&lt;p&gt;The plugin uses the same core.&lt;/p&gt;

&lt;p&gt;So the in-app agent and the script panel share the same underlying capabilities.&lt;/p&gt;

&lt;p&gt;No separate implementation required.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;@mlightcad/cad-mcp-server&lt;/code&gt; — MCP for external agents
&lt;/h3&gt;

&lt;p&gt;This is the part that lets other AI applications work with mlightcad.&lt;/p&gt;

&lt;p&gt;It supports MCP clients such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code&lt;/li&gt;
&lt;li&gt;Claude Desktop&lt;/li&gt;
&lt;li&gt;Cursor&lt;/li&gt;
&lt;li&gt;Codex&lt;/li&gt;
&lt;li&gt;Other compatible MCP clients&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The server uses stdio and launches Chromium through Playwright when the first tool call arrives.&lt;/p&gt;

&lt;p&gt;It runs the same &lt;code&gt;cad-simple-viewer&lt;/code&gt; kernel used by our products.&lt;/p&gt;

&lt;p&gt;The browser session persists across tool calls.&lt;/p&gt;

&lt;p&gt;In headless mode, it automatically closes after an idle timeout. In visible mode, you can watch the agent manipulate the drawing.&lt;/p&gt;

&lt;p&gt;The server exposes two tools:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;open_drawing&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Opens a local or remote DXF/DWG file, or starts with a blank ISO template&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;execute_cad_script&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Executes JavaScript against the current drawing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;One tool to open the drawing.&lt;/p&gt;

&lt;p&gt;One tool to do the actual work.&lt;/p&gt;

&lt;h3&gt;
  
  
  WebMCP — The next frontend
&lt;/h3&gt;

&lt;p&gt;We also plan to support WebMCP.&lt;/p&gt;

&lt;p&gt;Because the MCP tool registration is already separated into a reusable &lt;code&gt;registerCadMcpTools()&lt;/code&gt; function, a future WebMCP host can register the same tools inside a browser environment that already owns the CAD document manager.&lt;/p&gt;

&lt;p&gt;No need to launch another Chromium instance.&lt;/p&gt;

&lt;p&gt;Same core. Same tools. Another frontend.&lt;/p&gt;

&lt;p&gt;That's the advantage of this architecture: new capabilities are implemented once and become available to every frontend.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Why scripts beat a pile of MCP tools
&lt;/h2&gt;

&lt;p&gt;Let's get back to the original question.&lt;/p&gt;

&lt;p&gt;Why not simply expose every CAD operation as an MCP tool?&lt;/p&gt;

&lt;p&gt;Because CAD is not a small collection of predictable operations.&lt;/p&gt;

&lt;p&gt;It's a programming environment.&lt;/p&gt;

&lt;p&gt;Users can combine geometry, layers, blocks, text, measurements, and editing operations in almost unlimited ways.&lt;/p&gt;

&lt;p&gt;Trying to anticipate every possible workflow is a losing game.&lt;/p&gt;

&lt;h3&gt;
  
  
  The tool-sprawl problem
&lt;/h3&gt;

&lt;p&gt;Imagine we start with 20 tools.&lt;/p&gt;

&lt;p&gt;Then users ask for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finding circles with specific radii.&lt;/li&gt;
&lt;li&gt;Grouping entities by layer.&lt;/li&gt;
&lt;li&gt;Comparing dimensions.&lt;/li&gt;
&lt;li&gt;Extracting text from a particular region.&lt;/li&gt;
&lt;li&gt;Finding duplicate geometry.&lt;/li&gt;
&lt;li&gt;Exporting selected entities.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We add more tools.&lt;/p&gt;

&lt;p&gt;Then someone asks:&lt;/p&gt;

&lt;p&gt;"Find all circles smaller than 5, group them by layer, and report their IDs and radii."&lt;/p&gt;

&lt;p&gt;Do we create:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;find_small_circles_grouped_by_layer_and_report_radius&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Hopefully not.&lt;/p&gt;

&lt;p&gt;The problem is that every new workflow becomes another API design and implementation task.&lt;/p&gt;

&lt;p&gt;And the more tools we expose, the more information the model has to process before it even starts working.&lt;/p&gt;

&lt;h3&gt;
  
  
  The scripting alternative
&lt;/h3&gt;

&lt;p&gt;Instead of teaching the AI every possible combination, we let it combine existing capabilities.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Find circles smaller than radius 5,&lt;/span&gt;
&lt;span class="c1"&gt;// grouped by layer.&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;entities&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Circle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
      &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;radius&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;layer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;layer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;r&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;radius&lt;/span&gt;
  &lt;span class="p"&gt;}))&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the entire workflow.&lt;/p&gt;

&lt;p&gt;The model writes the logic.&lt;/p&gt;

&lt;p&gt;The CAD environment executes it.&lt;/p&gt;

&lt;p&gt;And the result comes back as structured data.&lt;/p&gt;

&lt;p&gt;No special-purpose tool required.&lt;/p&gt;

&lt;h3&gt;
  
  
  Three advantages that matter more than they first appear
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Fewer tokens&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose a drawing contains 100,000 entities.&lt;/p&gt;

&lt;p&gt;If the agent has to inspect them individually through tool calls, things get expensive very quickly.&lt;/p&gt;

&lt;p&gt;With scripting, the filtering and processing happen inside the CAD environment.&lt;/p&gt;

&lt;p&gt;The model receives only the relevant results.&lt;/p&gt;

&lt;p&gt;Instead of shipping 100,000 entities back and forth, we can return a small JSON summary.&lt;/p&gt;

&lt;p&gt;The drawing stays where it belongs.&lt;/p&gt;

&lt;p&gt;The model gets the information it actually needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Easier verification&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI-generated code can make mistakes.&lt;/p&gt;

&lt;p&gt;That's not exactly breaking news.&lt;/p&gt;

&lt;p&gt;But scripts can check their own results.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;measure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;report&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;measure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;radius&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;measure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent can perform an operation, inspect the result, and verify whether the expected conditions hold.&lt;/p&gt;

&lt;p&gt;We can also separate read-only analysis from drawing modifications.&lt;/p&gt;

&lt;p&gt;This makes it easier to build workflows that are not just intelligent, but reasonably trustworthy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Faster execution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Loops, filtering, and batch edits execute inside the CAD environment.&lt;/p&gt;

&lt;p&gt;The model doesn't need to make a new tool call for every entity.&lt;/p&gt;

&lt;p&gt;Think of the difference between asking someone to inspect 10,000 objects one by one and giving them a program that checks all 10,000 objects in one pass.&lt;/p&gt;

&lt;p&gt;Let the model decide what to do.&lt;/p&gt;

&lt;p&gt;Let the program do the repetitive work.&lt;/p&gt;

&lt;h3&gt;
  
  
  So, is MCP still useful?
&lt;/h3&gt;

&lt;p&gt;Absolutely.&lt;/p&gt;

&lt;p&gt;MCP is still the connection between the AI agent and external software.&lt;/p&gt;

&lt;p&gt;Explicit tools are still useful for lifecycle operations, such as opening a drawing.&lt;/p&gt;

&lt;p&gt;Scripts are useful for combining CAD capabilities into custom workflows.&lt;/p&gt;

&lt;p&gt;That's why our MCP server has two tools:&lt;/p&gt;

&lt;p&gt;One handles the drawing lifecycle.&lt;/p&gt;

&lt;p&gt;The other handles everything the agent wants to do with the drawing.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Getting started with the mlightcad MCP server
&lt;/h2&gt;

&lt;p&gt;Let's make this practical.&lt;/p&gt;

&lt;p&gt;You need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js 20 or later.&lt;/li&gt;
&lt;li&gt;A Playwright Chromium installation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Install the browser using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm &lt;span class="nt"&gt;--filter&lt;/span&gt; @mlightcad/cad-mcp-server install-browser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Claude Code / Claude Desktop
&lt;/h3&gt;

&lt;p&gt;Add the following configuration to your MCP settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"cad"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"--package=@mlightcad/cad-mcp-server@1.7.8-preview.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"cad-mcp-server"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Cursor
&lt;/h3&gt;

&lt;p&gt;The configuration is essentially the same:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"cad"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"--package=@mlightcad/cad-mcp-server@1.7.8-preview.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"cad-mcp-server"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the mlightcad monorepo, use the bundled &lt;code&gt;scripts/run-published.mjs&lt;/code&gt; launcher instead of raw &lt;code&gt;npx&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;See the &lt;a href="https://github.com/mlightcad/cad-viewer/tree/main/packages/cad-mcp-server" rel="noopener noreferrer"&gt;MCP server README&lt;/a&gt; for details.&lt;/p&gt;

&lt;h3&gt;
  
  
  A couple of useful environment variables
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CAD_MCP_VISIBLE=1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show a visible Chromium window by default&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CAD_MCP_IDLE_CLOSE_MS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Configure the headless idle timeout; default is 30,000 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  The typical workflow
&lt;/h3&gt;

&lt;p&gt;Every task follows the same basic pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Open a drawing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Call &lt;code&gt;open_drawing&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./plan.dxf"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"write"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also pass an HTTP or HTTPS URL.&lt;/p&gt;

&lt;p&gt;If you want to watch the agent work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./plan.dxf"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"write"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"visible"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Execute a script&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's a small example.&lt;/p&gt;

&lt;p&gt;Let's draw a circle with a radius of 100 and verify that it was created correctly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;

&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;circle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;tx&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawCircle&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;center&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zoomExtents&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;measure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;report&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;measure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;radius&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;measure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script creates the circle, adjusts the view, and checks the radius.&lt;/p&gt;

&lt;p&gt;One call.&lt;/p&gt;

&lt;p&gt;No &lt;code&gt;draw_circle&lt;/code&gt; tool.&lt;/p&gt;

&lt;p&gt;No &lt;code&gt;measure_circle&lt;/code&gt; tool.&lt;/p&gt;

&lt;p&gt;No &lt;code&gt;verify_circle&lt;/code&gt; tool.&lt;/p&gt;

&lt;p&gt;Just the scripting API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Saving the result
&lt;/h3&gt;

&lt;p&gt;To save the drawing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;saveDxf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./plan-out.dxf&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The MCP server writes the file and returns metadata such as its path and size.&lt;/p&gt;

&lt;p&gt;The DXF contents are not sent back to the model.&lt;/p&gt;

&lt;p&gt;This is important when working with large drawings.&lt;/p&gt;

&lt;p&gt;You don't want the model to spend its context window reading a file it just created.&lt;/p&gt;

&lt;p&gt;You want it to know the file exists and whether the operation succeeded.&lt;/p&gt;

&lt;p&gt;You can also capture a preview:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;capturePreview&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result can be attached as an image to the MCP response.&lt;/p&gt;

&lt;p&gt;So the agent can inspect the drawing visually when necessary.&lt;/p&gt;

&lt;p&gt;That's the basic workflow.&lt;/p&gt;

&lt;p&gt;Open the drawing.&lt;/p&gt;

&lt;p&gt;Write a script.&lt;/p&gt;

&lt;p&gt;Execute it.&lt;/p&gt;

&lt;p&gt;Check the result.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Three real experiments
&lt;/h2&gt;

&lt;p&gt;Now for the interesting part.&lt;/p&gt;

&lt;p&gt;I tested the MCP server on three drawing-processing tasks.&lt;/p&gt;

&lt;p&gt;These weren't three custom tools built specifically for the examples.&lt;/p&gt;

&lt;p&gt;They used the same two-tool MCP server and the existing CAD scripting API.&lt;/p&gt;

&lt;p&gt;The agent had to figure out how to combine the available capabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.1 Turning a line-drawn BOM into a Markdown table
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8s8gabx3mrtw6rl21f4j.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8s8gabx3mrtw6rl21f4j.webp" alt="Example 1 — table extraction" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The task&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In CAD, a table doesn't necessarily exist as a table object.&lt;/p&gt;

&lt;p&gt;Sometimes it's just a collection of lines and text.&lt;/p&gt;

&lt;p&gt;To a human, it looks like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Part No&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Qty&lt;/th&gt;
&lt;th&gt;Material&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;GP-001&lt;/td&gt;
&lt;td&gt;Housing&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;HT250&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;GP-002&lt;/td&gt;
&lt;td&gt;Cover&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;HT250&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;GP-003&lt;/td&gt;
&lt;td&gt;Shaft&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;45 Steel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;GP-004&lt;/td&gt;
&lt;td&gt;Bolt M8×30&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;8.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;GP-005&lt;/td&gt;
&lt;td&gt;Base Plate&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;HT200&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;To software, however, it's a bunch of geometry.&lt;/p&gt;

&lt;p&gt;There may be lines forming the grid, text inside each cell, and numbered balloons connecting the BOM to the assembly.&lt;/p&gt;

&lt;p&gt;I used a mechanical assembly drawing of a gear pump.&lt;/p&gt;

&lt;p&gt;The assembly view occupied most of the sheet, while the BOM sat above the title block.&lt;/p&gt;

&lt;p&gt;The task was simple:&lt;/p&gt;

&lt;p&gt;Extract the BOM and return it as a Markdown table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How the agent solved it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There was no &lt;code&gt;extract_bom&lt;/code&gt; tool.&lt;/p&gt;

&lt;p&gt;The agent wrote a short script to reconstruct the table.&lt;/p&gt;

&lt;p&gt;First, it collected text entities:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;texts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;entities&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Text&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;MText&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Attribute&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt;
  &lt;span class="p"&gt;}))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, it grouped text by approximate Y coordinates.&lt;/p&gt;

&lt;p&gt;Entities on the same horizontal row should have similar Y values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;texts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then it sorted the rows from top to bottom and the text within each row from left to right:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;row&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
          &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;
      &lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the script returned structured rows.&lt;/p&gt;

&lt;p&gt;The model converted those rows into Markdown.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The result&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The BOM was reconstructed as a Markdown table.&lt;/p&gt;

&lt;p&gt;The interesting part wasn't that the AI could read text.&lt;/p&gt;

&lt;p&gt;It was that the AI figured out how to reconstruct a table that didn't exist as a table object.&lt;/p&gt;

&lt;p&gt;The grouping rules were generated on the fly.&lt;/p&gt;

&lt;p&gt;If the row spacing or column arrangement was different, the agent could adjust the script and run it again.&lt;/p&gt;

&lt;p&gt;Nobody on the development team had to anticipate that particular table layout.&lt;/p&gt;

&lt;p&gt;And only the extracted data was returned to the model.&lt;/p&gt;

&lt;p&gt;The drawing itself stayed inside the CAD environment.&lt;/p&gt;

&lt;p&gt;That's the flexibility we were looking for.&lt;/p&gt;




&lt;h3&gt;
  
  
  4.2 Reading a drawing frame from top to bottom
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg0lyrm63nu13dtu1le2e.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg0lyrm63nu13dtu1le2e.webp" alt="Example 2 — frame extraction" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The task&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Production drawings usually contain a frame and title block.&lt;/p&gt;

&lt;p&gt;The title block may contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project name.&lt;/li&gt;
&lt;li&gt;Drawing title.&lt;/li&gt;
&lt;li&gt;Drawn-by and checked-by information.&lt;/li&gt;
&lt;li&gt;Scale.&lt;/li&gt;
&lt;li&gt;Date.&lt;/li&gt;
&lt;li&gt;Sheet number.&lt;/li&gt;
&lt;li&gt;Revision.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Humans can read this information easily.&lt;/p&gt;

&lt;p&gt;But to a CAD program, it's just a collection of entities.&lt;/p&gt;

&lt;p&gt;I asked the agent to extract all the information from the drawing frame and organize it into a structured record.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How the agent solved it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The script followed three steps.&lt;/p&gt;

&lt;p&gt;First, locate the frame.&lt;/p&gt;

&lt;p&gt;For this drawing, the agent used the largest closed polyline as the frame.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;frame&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;entities&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Polyline&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
      &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;closed&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;max&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;min&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;max&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;min&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;max&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;min&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;max&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;min&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Second, collect the entities inside the frame.&lt;/p&gt;

&lt;p&gt;The API provides &lt;code&gt;inBox()&lt;/code&gt; for this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;entities&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;inBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;max&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Text&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;MText&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Attribute&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Block attributes are included automatically.&lt;/p&gt;

&lt;p&gt;That means title blocks built from attributed block inserts can be processed without special handling.&lt;/p&gt;

&lt;p&gt;Third, the model organizes the extracted text into a structured object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The result&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"project"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PUMP STATION UPGRADE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PUMP DISCHARGE PIPING"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"drawnBy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"J. Chen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"checkedBy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"L. Wang"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scale"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1:50"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-10-12"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sheetNo"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"A-102"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"rev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"B"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The drawing geometry was never modified.&lt;/p&gt;

&lt;p&gt;This was a read-only operation.&lt;/p&gt;

&lt;p&gt;And because the output is structured JSON, it can go directly into a document-management database, search index, or CSV export.&lt;/p&gt;

&lt;p&gt;No need to manually read title blocks anymore.&lt;/p&gt;

&lt;p&gt;At least, not for this workflow.&lt;/p&gt;




&lt;h3&gt;
  
  
  4.3 Splitting a multi-sheet drawing into separate DXF files
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwevrfd8fh5cobkfcx23q.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwevrfd8fh5cobkfcx23q.webp" alt="Example 3 — split by frame" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The task&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some drawings contain multiple independent sheets inside one file.&lt;/p&gt;

&lt;p&gt;For example, a drawing might contain three framed sheets arranged side by side.&lt;/p&gt;

&lt;p&gt;I asked the agent to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find each frame.&lt;/li&gt;
&lt;li&gt;Keep the entities belonging to that frame.&lt;/li&gt;
&lt;li&gt;Remove everything else.&lt;/li&gt;
&lt;li&gt;Export the remaining drawing as an independent DXF.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In other words, turn one drawing into several drawings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How the agent solved it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This time, the task involved editing the drawing.&lt;/p&gt;

&lt;p&gt;The agent used &lt;code&gt;cad.edit.transaction&lt;/code&gt; to group the changes into one undoable operation.&lt;/p&gt;

&lt;p&gt;First, it located the frames:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;frames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;entities&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Polyline&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
      &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;closed&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then it selected the second frame as an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;box&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;frames&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;extents&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, it collected the entities inside the frame:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;inside&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;entities&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;inBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;box&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;box&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;max&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And identified everything outside:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;outside&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;entities&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;inside&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, it removed the unwanted entities and saved the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;edit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;isolate sheet 2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;tx&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;tx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;erase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;outside&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;saveDxf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./sheet-02.dxf&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;kept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;inside&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;removed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;outside&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent then reopened the original drawing and repeated the process for the other frames.&lt;/p&gt;

&lt;p&gt;Why reopen the original?&lt;/p&gt;

&lt;p&gt;Because we don't want the second export to start from an already modified drawing.&lt;/p&gt;

&lt;p&gt;Each sheet should be extracted from the pristine source.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The result&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The agent produced:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sheet-01.dxf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sheet-02.dxf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sheet-03.dxf&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each file contained one frame and its associated entities.&lt;/p&gt;

&lt;p&gt;The MCP server returned file metadata, including paths and sizes.&lt;/p&gt;

&lt;p&gt;The agent could verify that all three exports were non-empty before reporting success.&lt;/p&gt;

&lt;p&gt;The entire workflow was assembled from existing API operations.&lt;/p&gt;

&lt;p&gt;No one had to write a dedicated multi-sheet splitting tool.&lt;/p&gt;

&lt;p&gt;The agent combined entity queries, bounding boxes, transactions, and DXF export into a batch-processing workflow.&lt;/p&gt;

&lt;p&gt;That's a pretty useful capability for something we didn't explicitly program as a feature.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. What can you actually do with this?
&lt;/h2&gt;

&lt;p&gt;The three experiments demonstrate something broader than extracting a BOM.&lt;/p&gt;

&lt;p&gt;Once the agent can query, analyze, edit, and export CAD data through scripts, many drawing-processing tasks become combinations of existing capabilities.&lt;/p&gt;

&lt;p&gt;Here are some examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  Information extraction
&lt;/h3&gt;

&lt;p&gt;Extract information from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;BOMs.&lt;/li&gt;
&lt;li&gt;Title blocks.&lt;/li&gt;
&lt;li&gt;Schedules.&lt;/li&gt;
&lt;li&gt;Legends.&lt;/li&gt;
&lt;li&gt;Notes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the information is represented by text and geometry, the agent can often reconstruct its structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Drawing analysis
&lt;/h3&gt;

&lt;p&gt;Generate reports such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Entity counts by layer.&lt;/li&gt;
&lt;li&gt;Duplicate or overlapping geometry.&lt;/li&gt;
&lt;li&gt;Dimension checks.&lt;/li&gt;
&lt;li&gt;Unusual geometry.&lt;/li&gt;
&lt;li&gt;Drawing statistics.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The model can write scripts that inspect the drawing and return structured results.&lt;/p&gt;

&lt;h3&gt;
  
  
  Batch editing
&lt;/h3&gt;

&lt;p&gt;Perform operations such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Renaming layers.&lt;/li&gt;
&lt;li&gt;Moving groups of entities.&lt;/li&gt;
&lt;li&gt;Fixing linetypes.&lt;/li&gt;
&lt;li&gt;Inserting standard blocks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of editing entities one at a time, the agent can execute a batch script.&lt;/p&gt;

&lt;h3&gt;
  
  
  File processing
&lt;/h3&gt;

&lt;p&gt;Automate tasks such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Splitting drawings by frame.&lt;/li&gt;
&lt;li&gt;Merging sheets.&lt;/li&gt;
&lt;li&gt;Converting drawings.&lt;/li&gt;
&lt;li&gt;Exporting independent DXF files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Visual verification
&lt;/h3&gt;

&lt;p&gt;The agent can open a visible browser window and let you watch the drawing being manipulated.&lt;/p&gt;

&lt;p&gt;It can also capture a preview image for inspection.&lt;/p&gt;

&lt;p&gt;The point is not that every task will work perfectly on the first attempt.&lt;/p&gt;

&lt;p&gt;The point is that the agent can compose existing capabilities into workflows that developers never explicitly implemented.&lt;/p&gt;

&lt;p&gt;And when the API gets better, the agent gets better too.&lt;/p&gt;

&lt;p&gt;Every new method added to &lt;code&gt;cad-agent-core&lt;/code&gt; becomes available to the in-app agent, the MCP server, and the planned WebMCP host.&lt;/p&gt;

&lt;p&gt;No need to build a new tool for every new idea.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. The bigger picture: Give AI a workbench, not a menu
&lt;/h2&gt;

&lt;p&gt;We started with a familiar question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What tools should I expose so AI can use my software?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Our answer is becoming a little different.&lt;/p&gt;

&lt;p&gt;Instead of trying to enumerate every possible operation, give AI a documented scripting API, a controlled execution environment, and a small number of tools for connecting to the application.&lt;/p&gt;

&lt;p&gt;In mlightcad, that means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A shared agent core.&lt;/li&gt;
&lt;li&gt;A sandboxed JavaScript API.&lt;/li&gt;
&lt;li&gt;One tool for opening drawings.&lt;/li&gt;
&lt;li&gt;One tool for executing scripts.&lt;/li&gt;
&lt;li&gt;Structured results and optional visual previews.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent can inspect a drawing, generate code, execute it, verify the result, and save the output.&lt;/p&gt;

&lt;p&gt;And developers don't need to anticipate every possible combination of CAD operations.&lt;/p&gt;

&lt;p&gt;We still need explicit tools.&lt;/p&gt;

&lt;p&gt;We still need MCP.&lt;/p&gt;

&lt;p&gt;But we don't need to turn every CAD API method into a separate tool.&lt;/p&gt;

&lt;p&gt;Sometimes the best interface for AI isn't a bigger toolbox.&lt;/p&gt;

&lt;p&gt;It's a workbench where the AI can write its own instructions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try it yourself
&lt;/h2&gt;

&lt;p&gt;The mlightcad MCP server is available here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repository:&lt;/strong&gt; &lt;a href="https://github.com/mlightcad/cad-viewer" rel="noopener noreferrer"&gt;github.com/mlightcad/cad-viewer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP server on npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/@mlightcad/cad-mcp-server" rel="noopener noreferrer"&gt;@mlightcad/cad-mcp-server&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Script API documentation:&lt;/strong&gt; &lt;a href="https://mlightcad.com/cad-viewer/docs/guide/script/api.html" rel="noopener noreferrer"&gt;mlightcad Script API&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The original design discussion:&lt;/strong&gt; &lt;a href="https://dev.to/mlightcad/building-a-cad-agent-mcp-tools-or-let-ai-write-code-2nc4"&gt;Building a CAD Agent: MCP, Tools, or Let AI Write Code?&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The MCP server currently uses the preview package version &lt;code&gt;1.7.8-preview.1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you're building an AI agent for CAD, I'd be interested to hear how you're approaching the interface.&lt;/p&gt;

&lt;p&gt;Are you building a tool for every operation?&lt;/p&gt;

&lt;p&gt;Or are you giving the agent a scripting environment and letting it compose the operations itself?&lt;/p&gt;

&lt;p&gt;Because in our experience, the second approach gets interesting very quickly.&lt;/p&gt;

&lt;p&gt;And it saves us from maintaining a 500-item tool menu.&lt;/p&gt;

&lt;p&gt;Which, frankly, is a feature I don't think anyone wants to use.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>mcp</category>
    </item>
    <item>
      <title>Building a CAD Agent: MCP, Tools, or Let AI Write Code?</title>
      <dc:creator>Mlight Lee</dc:creator>
      <pubDate>Sun, 18 Oct 2026 14:31:47 +0000</pubDate>
      <link>https://dev.to/mlightcad/building-a-cad-agent-mcp-tools-or-let-ai-write-code-2nc4</link>
      <guid>https://dev.to/mlightcad/building-a-cad-agent-mcp-tools-or-let-ai-write-code-2nc4</guid>
      <description>&lt;p&gt;If you were building a CAD agent, how would you do it?&lt;/p&gt;

&lt;p&gt;The most obvious approach is to wrap CAD APIs as tools and expose them to AI through MCP.&lt;/p&gt;

&lt;p&gt;Need to draw a line? Give it a &lt;code&gt;drawLine&lt;/code&gt; tool.&lt;/p&gt;

&lt;p&gt;Need to create a circle? Add &lt;code&gt;createCircle&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Need to change an entity's layer? Here comes &lt;code&gt;setEntityLayer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Not enough functionality? Just keep adding tools.&lt;/p&gt;

&lt;p&gt;Everything sounds fine until you've built 500 tools and users can still find a hundred things your agent can't do.&lt;/p&gt;

&lt;p&gt;Congratulations! You might not be building a CAD agent anymore. You might be building an entirely new CAD API product just for AI.&lt;/p&gt;

&lt;p&gt;Okay, that's a bit of an exaggeration. But as coding agents like Codex, Claude Code, and Cursor continue to evolve, I've started thinking seriously about a different approach:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instead of teaching AI to call hundreds of tools, why not let it write code to operate CAD directly?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl4nok8t8x0vcssrfgbb4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl4nok8t8x0vcssrfgbb4.jpg" alt="Building a CAD Agent: MCP, Tools, or Let AI Write Code?" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What's changed in AI agents over the past six months?
&lt;/h2&gt;

&lt;p&gt;In the past, if you asked an AI to fix a bug, the typical workflow was to read the code, figure out what might be wrong, and modify the implementation.&lt;/p&gt;

&lt;p&gt;Modern coding agents increasingly take a different approach.&lt;/p&gt;

&lt;p&gt;Can't figure out a bug? Write a script to analyze the logs.&lt;/p&gt;

&lt;p&gt;Can't reproduce the issue? Write a test program.&lt;/p&gt;

&lt;p&gt;Suspect a variable contains the wrong value? Add some debugging code and inspect what actually happens at runtime.&lt;/p&gt;

&lt;p&gt;Fixed the bug? Run the tests again to make sure it's really fixed.&lt;/p&gt;

&lt;p&gt;AI is no longer just reading and generating code. It's increasingly using code as a tool for solving problems.&lt;/p&gt;

&lt;p&gt;That's an important shift.&lt;/p&gt;

&lt;p&gt;We used to ask: How can we teach AI to call the capabilities our software provides?&lt;/p&gt;

&lt;p&gt;Now we can ask a different question: Can we let AI write programs that combine those capabilities to solve problems on its own?&lt;/p&gt;

&lt;p&gt;For complex software like CAD, I think this is a direction worth taking seriously.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Can a collection of tools really cover everything?
&lt;/h2&gt;

&lt;p&gt;Imagine a user asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Find all circles whose diameters are close to standard bolt-hole sizes, exclude objects on reference layers, group the results by component, identify outliers, and generate a report.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We could provide a collection of tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Query entities and retrieve their properties.&lt;/li&gt;
&lt;li&gt;Inspect block references and layer information.&lt;/li&gt;
&lt;li&gt;Create selection sets and modify entities.&lt;/li&gt;
&lt;li&gt;Calculate geometric relationships and measure distances.&lt;/li&gt;
&lt;li&gt;Create annotations and export reports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But what happens when the existing tools don't support the user's particular classification rules?&lt;/p&gt;

&lt;p&gt;Build another tool?&lt;/p&gt;

&lt;p&gt;And when the user wants to classify components by mounting position instead?&lt;/p&gt;

&lt;p&gt;Another tool?&lt;/p&gt;

&lt;p&gt;What if they want to compare suspicious holes against a second drawing?&lt;/p&gt;

&lt;p&gt;You can probably see where this is going.&lt;/p&gt;

&lt;p&gt;The development cycle becomes familiar: users request new capabilities, developers build new tools, and users immediately come up with requirements that those tools don't cover.&lt;/p&gt;

&lt;p&gt;Eventually, the tool catalog grows, but the agent's ability to handle unexpected tasks hasn't improved nearly as much as we'd hoped.&lt;/p&gt;

&lt;p&gt;To be clear, MCP isn't the problem. It provides a standardized way for AI applications to discover and invoke external capabilities.&lt;/p&gt;

&lt;p&gt;The real question is this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does every capability of a complex application need to be wrapped as a separate AI tool?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Why not let AI write code directly?
&lt;/h2&gt;

&lt;p&gt;Let's try a different approach.&lt;/p&gt;

&lt;p&gt;Suppose our CAD application provides a JavaScript or Python scripting environment, with APIs for accessing the drawing database, querying entities, performing geometric operations, and modifying properties.&lt;/p&gt;

&lt;p&gt;Instead of calling tools one by one, the AI writes a script.&lt;/p&gt;

&lt;p&gt;For example, to find all circles with a radius smaller than 5:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;circles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cad&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getEntities&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;CIRCLE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;circles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;circle&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="nx"&gt;circle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;radius&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;circle&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;circle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;circle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;layer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;circle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;layer&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is illustrative pseudocode. The actual API depends on the CAD application's implementation.&lt;/p&gt;

&lt;p&gt;For such a simple task, ordinary tool calling works perfectly well.&lt;/p&gt;

&lt;p&gt;The difference becomes more interesting when the task involves analyzing diameter distributions, identifying likely bolt holes, excluding certain layers, classifying components, and finding dimensions that deviate from common sizes.&lt;/p&gt;

&lt;p&gt;The AI can write its own loops, filters, statistical calculations, and classification logic.&lt;/p&gt;

&lt;p&gt;The first result looks wrong? Modify the script and run it again.&lt;/p&gt;

&lt;p&gt;The drawing contains nested blocks? Adjust the traversal logic.&lt;/p&gt;

&lt;p&gt;A particular component uses a special naming convention? Incorporate that rule into the program.&lt;/p&gt;

&lt;p&gt;Developers don't have to anticipate every possible requirement, and they don't need to build a dedicated tool for each one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The software provides the capabilities. The AI writes the logic.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's what makes scripting so interesting as an interface for AI agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Three underrated advantages of letting AI write scripts
&lt;/h2&gt;

&lt;p&gt;Flexibility is the obvious benefit. But I think there are three other practical advantages: fewer tokens, easier verification, and potentially faster execution.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.1. Fewer tokens: Don't make AI inspect 100,000 entities one by one
&lt;/h3&gt;

&lt;p&gt;Imagine a drawing with 100,000 entities. The user wants to find objects that satisfy a particular set of conditions.&lt;/p&gt;

&lt;p&gt;With a tool-calling workflow, the agent might repeatedly query entities, retrieve results, analyze them, and decide what to do next. Depending on the API design, large amounts of intermediate data and tool-call history can end up in the model's context.&lt;/p&gt;

&lt;p&gt;If the tools aren't designed well, the AI can spend a surprising amount of its token budget just moving information around before it even starts solving the problem.&lt;/p&gt;

&lt;p&gt;A script can iterate through the entities, perform calculations, and filter the results directly inside the execution environment. Only the useful findings need to be returned to the model.&lt;/p&gt;

&lt;p&gt;Suppose the script finds three suspicious entities among 100,000. The agent may only need to inspect those three entities and a few summary statistics, rather than processing details about all 100,000.&lt;/p&gt;

&lt;p&gt;Of course, tools can support batch queries, and scripts consume tokens too. But for data-intensive tasks, letting code process the data while the model focuses on the results is often more economical.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't make AI do the manual labor. Let it write a program to do the manual labor.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.2. Easier verification: Don't just say it worked. Show me the evidence.
&lt;/h3&gt;

&lt;p&gt;Suppose an AI tells you it found 20 suspicious objects.&lt;/p&gt;

&lt;p&gt;Are you ready to trust it?&lt;/p&gt;

&lt;p&gt;If those objects are part of a mechanical design, perhaps let's not celebrate just yet.&lt;/p&gt;

&lt;p&gt;With scripts, we can express verification logic directly in the program.&lt;/p&gt;

&lt;p&gt;For example, we can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check whether the selected entities satisfy the specified geometric conditions.&lt;/li&gt;
&lt;li&gt;Verify that the number of modified entities is reasonable.&lt;/li&gt;
&lt;li&gt;Confirm that entity handles are still valid.&lt;/li&gt;
&lt;li&gt;Check whether the updated properties match the expected values.&lt;/li&gt;
&lt;li&gt;Run assertions or regression tests against important results.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can also separate analysis from modification. First, run a read-only script that produces a proposed change list. Validate the list, and only then apply the changes.&lt;/p&gt;

&lt;p&gt;If the results don't match expectations, the agent can inspect error messages and intermediate data, modify the script, and try again.&lt;/p&gt;

&lt;p&gt;There's another advantage: verified scripts can be saved and reused. For recurring drawing-inspection tasks, they can gradually become a library of reusable automation rules.&lt;/p&gt;

&lt;p&gt;Tool-based workflows can certainly be verified too, but they may require additional mechanisms to validate the results of many separate calls and decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI is allowed to make mistakes. But it should at least have a way to use code to check whether it's right.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.3. Faster execution: Fewer meetings, more work
&lt;/h3&gt;

&lt;p&gt;Imagine processing 5,000 entities.&lt;/p&gt;

&lt;p&gt;One approach is to let the AI repeatedly call tools, inspect each response, and decide what to do next.&lt;/p&gt;

&lt;p&gt;Another is to let the AI write a loop and a set of filtering rules, then execute the whole thing in one go.&lt;/p&gt;

&lt;p&gt;Which approach is more likely to be faster?&lt;/p&gt;

&lt;p&gt;Usually, the second one.&lt;/p&gt;

&lt;p&gt;The reason isn't just that code executes quickly. It's also that the model doesn't need to participate in every individual operation.&lt;/p&gt;

&lt;p&gt;Each round of model inference, tool invocation, and result processing can introduce additional latency. When a task requires dozens or hundreds of sequential interactions, the overhead adds up.&lt;/p&gt;

&lt;p&gt;Loops, conditionals, geometric calculations, and batch operations can instead run directly in the execution environment.&lt;/p&gt;

&lt;p&gt;Of course, if the task is simply to draw one line, calling a dedicated tool may be simpler and faster. There's no need to write an entire automation program just to draw a line.&lt;/p&gt;

&lt;p&gt;Scripting becomes particularly attractive when tasks involve large datasets, complex logic, or repeated calculations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let the model think and let the program execute. Don't make an expensive brain spend its time deciding whether every single circle deserves to be selected.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Does this mean MCP and tools are obsolete?
&lt;/h2&gt;

&lt;p&gt;Of course not.&lt;/p&gt;

&lt;p&gt;I don't think future software agents should abandon MCP or tools. They solve different problems.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MCP&lt;/strong&gt; is useful for connecting external systems and exposing remote capabilities through a standardized interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tools&lt;/strong&gt; are useful for clearly defined operations, such as opening a drawing, exporting a file, or requesting user approval.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scripts&lt;/strong&gt; are useful for combining APIs into complex analysis, calculations, and automation workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These mechanisms can coexist.&lt;/p&gt;

&lt;p&gt;For example, a CAD agent might use a tool to open a drawing, MCP to query an external parts database, and JavaScript to analyze the drawing geometry against the retrieved component data.&lt;/p&gt;

&lt;p&gt;This architecture combines the convenience of explicit tools with the flexibility of code.&lt;/p&gt;

&lt;p&gt;Naturally, a scripting environment needs proper safeguards. These include restricting file and network access, setting execution time limits, controlling modification permissions, and supporting transactions and undo operations.&lt;/p&gt;

&lt;p&gt;Letting AI write code doesn't mean giving it an unrestricted bulldozer and hoping for the best.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. This isn't just a CAD problem
&lt;/h2&gt;

&lt;p&gt;I think the same approach applies to GIS, 3D modeling, simulation software, and even office applications.&lt;/p&gt;

&lt;p&gt;These applications often have complex data models and rich sets of underlying operations. But developers cannot anticipate every possible task users might eventually ask an AI to perform.&lt;/p&gt;

&lt;p&gt;Instead of continuously adding specialized AI tools, we could provide a well-designed, well-documented API and a reliable scripting environment that AI can use.&lt;/p&gt;

&lt;p&gt;Need a new analysis method? AI writes code.&lt;/p&gt;

&lt;p&gt;Need a custom filtering rule? AI writes code.&lt;/p&gt;

&lt;p&gt;Need to combine a dozen operations into a workflow? AI writes code again.&lt;/p&gt;

&lt;p&gt;Software vendors no longer need to implement a dedicated feature for every new requirement, and agents aren't restricted to a predefined list of tools.&lt;/p&gt;

&lt;p&gt;Of course, generated code isn't automatically correct. Engineering tasks and modifications to important data still require appropriate verification and, where necessary, human review.&lt;/p&gt;

&lt;p&gt;But at least the agent has a more general way to attempt solving the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Don't just give AI a hammer. Give it a toolbox and a workbench.
&lt;/h2&gt;

&lt;p&gt;We used to ask:&lt;/p&gt;

&lt;p&gt;What tools should I provide so that AI can use my software?&lt;/p&gt;

&lt;p&gt;Now I think a more interesting question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What kind of programming environment should I provide so that AI can solve problems on its own?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The evolution of coding agents suggests that code is becoming a general-purpose problem-solving mechanism. It's no longer just the final product of software development. It's also a way to investigate problems, test hypotheses, process data, and automate operations.&lt;/p&gt;

&lt;p&gt;For CAD agents, I favor an approach built around a dynamic language such as JavaScript or Python, a sufficiently complete CAD API, and an environment where AI can write, execute, debug, and iterate on its code.&lt;/p&gt;

&lt;p&gt;MCP and tools still have an important role, but they shouldn't be the only way AI interacts with complex software.&lt;/p&gt;

&lt;p&gt;After all, we can't possibly build every CAD feature our users will ever need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instead of endlessly adding new tools for AI to call, why not let AI use existing capabilities to write programs that solve problems we haven't anticipated?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For software developers, this might mean writing less repetitive glue code.&lt;/p&gt;

&lt;p&gt;For AI, it means no longer having to raise its hand every time it encounters a new problem and ask:&lt;/p&gt;

&lt;p&gt;"Excuse me, is there a tool specifically designed for this?"&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Beyond Desktop CAD in the Browser: CADCraft vs. OpenCAD Studio vs. MLightCAD CAD Viewer</title>
      <dc:creator>Mlight Lee</dc:creator>
      <pubDate>Thu, 15 Oct 2026 02:44:32 +0000</pubDate>
      <link>https://dev.to/mlightcad/beyond-desktop-cad-in-the-browser-cadcraft-vs-opencad-studio-vs-mlightcad-cad-viewer-4078</link>
      <guid>https://dev.to/mlightcad/beyond-desktop-cad-in-the-browser-cadcraft-vs-opencad-studio-vs-mlightcad-cad-viewer-4078</guid>
      <description>&lt;h2&gt;
  
  
  Why Browser-First Architecture Matters for Real-World CAD Performance
&lt;/h2&gt;

&lt;p&gt;The evolution of WebAssembly, WebGL, and modern browser runtimes has made it increasingly practical to bring professional CAD capabilities to the web.&lt;/p&gt;

&lt;p&gt;Today, users expect more than an online drawing preview. They want to open DWG and DXF files, inspect complex engineering drawings, create and modify entities, manage layers, measure geometry, and edit drawings—all without installing a traditional desktop CAD application.&lt;/p&gt;

&lt;p&gt;Three projects illustrate different approaches to this challenge: CADCraft, OpenCAD Studio, and MLightCAD CAD Viewer.&lt;/p&gt;

&lt;p&gt;All three bring CAD capabilities to the browser, but they differ in their architectural priorities.&lt;/p&gt;

&lt;p&gt;CADCraft and OpenCAD Studio emphasize cross-platform applications that can run on desktop and web environments. MLightCAD CAD Viewer takes a more browser-oriented approach, focusing on CAD rendering, editing, performance optimization, and integration into web applications.&lt;/p&gt;

&lt;p&gt;That distinction becomes particularly important when working with large drawings.&lt;/p&gt;

&lt;p&gt;In my hands-on testing, CADCraft and OpenCAD Studio experienced substantial lag when opening and editing large drawings. MLightCAD CAD Viewer, by comparison, delivered a noticeably smoother experience.&lt;/p&gt;

&lt;p&gt;This observation is consistent with MLightCAD's published engineering work on geometry batching, rendering optimization, text processing, and large-scale entity interaction.&lt;/p&gt;

&lt;p&gt;This article compares the three products across architecture, technology stack, performance, file handling, editing capabilities, integration, deployment, and product positioning—with particular emphasis on browser-based CAD.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm84tihbf3psz58u83ulo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm84tihbf3psz58u83ulo.jpg" alt="Comparison" width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Three Products, Three Different Priorities
&lt;/h2&gt;

&lt;h3&gt;
  
  
  CADCraft: Lightweight CAD with a Shared Cross-Platform Core
&lt;/h3&gt;

&lt;p&gt;CADCraft is an open-source CAD application built primarily with Rust. Its architecture separates geometry processing, drawing data, file handling, rendering, and command functionality into distinct modules.&lt;/p&gt;

&lt;p&gt;It provides desktop and browser versions, using WebAssembly to bring core CAD functionality into the web environment.&lt;/p&gt;

&lt;p&gt;Its main strengths include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  A shared core that can support multiple deployment targets.&lt;/li&gt;
&lt;li&gt;  Rust-based geometry and drawing-data processing.&lt;/li&gt;
&lt;li&gt;  Lightweight 2D drafting workflows.&lt;/li&gt;
&lt;li&gt;  DXF-oriented file handling and editing.&lt;/li&gt;
&lt;li&gt;  Command-based drawing operations and familiar CAD concepts.&lt;/li&gt;
&lt;li&gt;  The ability to use CAD capabilities without installing a conventional desktop application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CADCraft is an appealing option for users who want a lightweight 2D CAD tool and the flexibility to run it on either desktop or web platforms.&lt;/p&gt;

&lt;p&gt;However, cross-platform architecture and browser performance are separate engineering challenges. Sharing the same core logic does not automatically guarantee that large drawings will open quickly or remain responsive during editing.&lt;/p&gt;

&lt;p&gt;Project repository: &lt;a href="https://github.com/cadcraft-app/cadcraft" rel="noopener noreferrer"&gt;CADCraft on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  OpenCAD Studio: A General CAD Environment Across Desktop and Web
&lt;/h3&gt;

&lt;p&gt;OpenCAD Studio also uses Rust and WebAssembly to provide CAD functionality across desktop and browser environments. Its scope extends beyond 2D drafting to include selected 3D solid-modeling capabilities.&lt;/p&gt;

&lt;p&gt;Its publicly described features include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  DWG and DXF file support.&lt;/li&gt;
&lt;li&gt;  Command-oriented 2D drafting.&lt;/li&gt;
&lt;li&gt;  Layers, layouts, and drawing management.&lt;/li&gt;
&lt;li&gt;  GPU-accelerated viewport rendering.&lt;/li&gt;
&lt;li&gt;  Selected 3D modeling capabilities.&lt;/li&gt;
&lt;li&gt;  Desktop and browser deployment options.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This broader scope makes OpenCAD Studio attractive to users looking for a general-purpose CAD environment rather than a narrowly focused browser editor.&lt;/p&gt;

&lt;p&gt;However, desktop capabilities do not automatically translate into the same experience in a browser. Browser execution introduces its own constraints involving memory, task scheduling, file processing, and UI responsiveness.&lt;/p&gt;

&lt;p&gt;OpenCAD Studio's suitability for large browser-based drawings should therefore be evaluated separately from its desktop capabilities.&lt;/p&gt;

&lt;p&gt;Project website: &lt;a href="https://www.opencad.studio/" rel="noopener noreferrer"&gt;OpenCAD Studio&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  MLightCAD CAD Viewer: A Browser-Native CAD Editor and Rendering Engine
&lt;/h3&gt;

&lt;p&gt;The name "MLightCAD CAD Viewer" can be misleading. It may sound like a read-only viewer, but the product supports genuine CAD editing workflows, including creating, modifying, and deleting drawing entities.&lt;/p&gt;

&lt;p&gt;Its browser-oriented capabilities include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  DWG/DXF loading and drawing display.&lt;/li&gt;
&lt;li&gt;  Entity selection and editing.&lt;/li&gt;
&lt;li&gt;  Layer and property management.&lt;/li&gt;
&lt;li&gt;  Measurement and annotation workflows.&lt;/li&gt;
&lt;li&gt;  WebGL-based rendering through the Three.js ecosystem.&lt;/li&gt;
&lt;li&gt;  Component and SDK integration into web applications.&lt;/li&gt;
&lt;li&gt;  Modular extensions for additional drawing and export workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rather than treating the browser as simply another platform for a desktop application, MLightCAD focuses on delivering CAD functionality within the browser's native application and graphics environment.&lt;/p&gt;

&lt;p&gt;The objective is not merely to make an existing CAD core run on the web. It is to provide practical web-based CAD capabilities that can be used directly by end users or embedded into other software.&lt;/p&gt;

&lt;p&gt;Official resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://github.com/mlightcad/cad-viewer" rel="noopener noreferrer"&gt;MLightCAD CAD Viewer on GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://mlightcad.com/" rel="noopener noreferrer"&gt;MLightCAD Official Website&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://mlightcad.com/cad-viewer/docs/" rel="noopener noreferrer"&gt;MLightCAD CAD Viewer Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Architecture and Technology Stack
&lt;/h2&gt;

&lt;p&gt;The most useful way to compare these products is to examine how their architectures address the needs of their target environments.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;CADCraft&lt;/th&gt;
&lt;th&gt;OpenCAD Studio&lt;/th&gt;
&lt;th&gt;MLightCAD CAD Viewer&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Product positioning&lt;/td&gt;
&lt;td&gt;Lightweight 2D CAD&lt;/td&gt;
&lt;td&gt;General-purpose CAD environment&lt;/td&gt;
&lt;td&gt;Browser-oriented CAD editor and rendering engine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Primary focus&lt;/td&gt;
&lt;td&gt;Cross-platform drafting&lt;/td&gt;
&lt;td&gt;2D drafting and selected 3D modeling&lt;/td&gt;
&lt;td&gt;Web-based CAD editing and integration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Architecture&lt;/td&gt;
&lt;td&gt;Shared cross-platform core&lt;/td&gt;
&lt;td&gt;Shared cross-platform core&lt;/td&gt;
&lt;td&gt;Browser-oriented rendering and editing architecture&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Core technologies&lt;/td&gt;
&lt;td&gt;Rust and WebAssembly&lt;/td&gt;
&lt;td&gt;Rust and WebAssembly&lt;/td&gt;
&lt;td&gt;JavaScript/TypeScript, Three.js, WebGL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Desktop support&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Browser-first&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser support&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rendering approach&lt;/td&gt;
&lt;td&gt;Depends on the implementation and build&lt;/td&gt;
&lt;td&gt;GPU-accelerated viewport rendering&lt;/td&gt;
&lt;td&gt;WebGL-based rendering with CAD-specific optimization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large-drawing optimization&lt;/td&gt;
&lt;td&gt;Evaluate against representative workloads&lt;/td&gt;
&lt;td&gt;Evaluate against representative workloads&lt;/td&gt;
&lt;td&gt;Documented work on geometry batching, text rendering, and entity interaction&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integration model&lt;/td&gt;
&lt;td&gt;Standalone application approach&lt;/td&gt;
&lt;td&gt;Standalone application approach&lt;/td&gt;
&lt;td&gt;Web application and SDK-oriented integration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The key distinction is not simply the programming language. Rust and WebAssembly can provide an excellent foundation for CAD, while JavaScript and WebGL can also support demanding workloads.&lt;/p&gt;

&lt;p&gt;What matters is how the complete system handles geometry processing, rendering overhead, browser responsiveness, and incremental updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.1 The Strengths of Rust and WebAssembly
&lt;/h3&gt;

&lt;p&gt;Rust is well suited to computationally intensive software, including geometry operations, drawing databases, and CAD algorithms. WebAssembly makes it possible to execute compiled code inside a browser, allowing developers to reuse substantial portions of a native application core.&lt;/p&gt;

&lt;p&gt;This approach has several benefits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Core algorithms can be shared across desktop and browser versions.&lt;/li&gt;
&lt;li&gt; Geometry processing can remain in a compiled implementation.&lt;/li&gt;
&lt;li&gt; Multiple deployment targets can use common data structures and business logic.&lt;/li&gt;
&lt;li&gt; Developers can avoid maintaining entirely separate implementations of every CAD operation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These are meaningful architectural advantages. However, they do not eliminate browser-specific constraints.&lt;/p&gt;

&lt;p&gt;WebAssembly applications still need to manage browser memory, JavaScript interoperability, file access, graphics APIs, and task scheduling.&lt;/p&gt;

&lt;p&gt;A drawing operation that performs well on the desktop can behave differently in a browser, especially when expensive work competes with UI updates on the main thread.&lt;/p&gt;

&lt;p&gt;The important distinction is that &lt;strong&gt;cross-platform code reuse is not the same thing as large-drawing performance optimization&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 The Browser-First Approach
&lt;/h3&gt;

&lt;p&gt;MLightCAD uses browser graphics technologies, including Three.js and WebGL, as part of its rendering architecture.&lt;/p&gt;

&lt;p&gt;Its engineering work addresses problems that are particularly important for CAD: large numbers of line and point entities, repeated geometry, text-heavy drawings, complex line styles, entity selection, and large coordinate ranges.&lt;/p&gt;

&lt;p&gt;A browser-first architecture can also simplify integration with existing web applications. The CAD engine can become one component of a larger product rather than a separate application that users must launch independently.&lt;/p&gt;

&lt;p&gt;This approach is particularly attractive for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Engineering project-management systems.&lt;/li&gt;
&lt;li&gt;  Online drawing review and collaboration platforms.&lt;/li&gt;
&lt;li&gt;  Manufacturing and product-data applications.&lt;/li&gt;
&lt;li&gt;  Industry-specific SaaS products.&lt;/li&gt;
&lt;li&gt;  Web applications that need CAD editing without building an entire CAD engine from scratch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Browser-first design does not guarantee superior performance by itself. Its value comes from combining the appropriate runtime, rendering strategy, data structures, and interaction model for browser-based workloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Large Drawings Are the Real Performance Test
&lt;/h2&gt;

&lt;p&gt;A CAD application can perform well on a simple floor plan and still struggle badly with a large engineering drawing.&lt;/p&gt;

&lt;p&gt;Unlike a conventional image, a CAD drawing contains structured entities: lines, arcs, polylines, hatches, text, dimensions, blocks, and other objects.&lt;/p&gt;

&lt;p&gt;These entities may need to be parsed, transformed into display geometry, rendered, indexed for selection, and updated when the user edits them.&lt;/p&gt;

&lt;p&gt;A drawing with tens of thousands of entities can generate a much larger amount of rendering data, particularly when it contains complex hatches, detailed text, or repeated geometry.&lt;/p&gt;

&lt;p&gt;Several bottlenecks can emerge.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.1 Geometry Generation
&lt;/h3&gt;

&lt;p&gt;CAD entities are not always directly renderable. Complex polylines, arcs, and hatch patterns may need to be converted into display geometry.&lt;/p&gt;

&lt;p&gt;A relatively compact drawing file can therefore generate a large number of vertices and indices.&lt;/p&gt;

&lt;p&gt;If geometry must be regenerated unnecessarily during zooming, editing, or layer changes, the cost can grow quickly.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 Draw-Call Overhead
&lt;/h3&gt;

&lt;p&gt;If every entity is represented by an independent rendering object, a large drawing can create a substantial number of draw calls.&lt;/p&gt;

&lt;p&gt;Each draw call introduces CPU-side overhead, including rendering-state changes, buffer bindings, and communication with the GPU.&lt;/p&gt;

&lt;p&gt;At sufficient scale, these costs can become a bottleneck even when the GPU has ample processing power.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.3 Text and Font Processing
&lt;/h3&gt;

&lt;p&gt;Engineering drawings often contain thousands of labels, dimensions, notes, and table entries.&lt;/p&gt;

&lt;p&gt;CAD text may require specialized parsing and layout, while SHX fonts can require stroke-based processing rather than ordinary browser text rendering.&lt;/p&gt;

&lt;p&gt;Consequently, text handling can affect loading time, memory usage, and rendering responsiveness.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.4 Selection and Editing
&lt;/h3&gt;

&lt;p&gt;An editor must do more than display geometry. It must also identify selectable entities, handle user interaction, update object properties, and reflect edits on screen.&lt;/p&gt;

&lt;p&gt;If selecting an entity requires checking too many objects, or modifying one object triggers an unnecessarily broad scene rebuild, interaction latency becomes noticeable.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.5 Browser Main-Thread Blocking
&lt;/h3&gt;

&lt;p&gt;Long-running parsing or geometry-generation tasks can prevent the browser from responding promptly to mouse and keyboard events.&lt;/p&gt;

&lt;p&gt;The result is the familiar experience of a frozen canvas, delayed zooming, or an interface that appears unresponsive.&lt;/p&gt;

&lt;p&gt;These problems require more than a faster programming language. They require deliberate optimization across parsing, geometry generation, rendering, caching, selection, and incremental updates.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Large-Drawing Performance: Hands-On Observations
&lt;/h2&gt;

&lt;p&gt;In my hands-on testing, CADCraft and OpenCAD Studio showed substantial lag when opening and editing large drawings. MLightCAD CAD Viewer performed considerably better.&lt;/p&gt;

&lt;p&gt;The following table summarizes my observations alongside the architectural factors relevant to each product.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Performance Dimension&lt;/th&gt;
&lt;th&gt;CADCraft&lt;/th&gt;
&lt;th&gt;OpenCAD Studio&lt;/th&gt;
&lt;th&gt;MLightCAD CAD Viewer&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Opening large drawings&lt;/td&gt;
&lt;td&gt;Significant lag observed in my testing&lt;/td&gt;
&lt;td&gt;Significant lag observed in my testing&lt;/td&gt;
&lt;td&gt;Noticeably smoother in my testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Editing large drawings&lt;/td&gt;
&lt;td&gt;Significant interaction lag observed&lt;/td&gt;
&lt;td&gt;Significant interaction lag observed&lt;/td&gt;
&lt;td&gt;More responsive in my testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Geometry batching&lt;/td&gt;
&lt;td&gt;Must be evaluated in the tested version&lt;/td&gt;
&lt;td&gt;Must be evaluated in the tested version&lt;/td&gt;
&lt;td&gt;Documented batching architecture&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Text rendering optimization&lt;/td&gt;
&lt;td&gt;Requires workload-specific validation&lt;/td&gt;
&lt;td&gt;Requires workload-specific validation&lt;/td&gt;
&lt;td&gt;Dedicated text-rendering engineering documented&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Incremental entity updates&lt;/td&gt;
&lt;td&gt;Requires workload-specific validation&lt;/td&gt;
&lt;td&gt;Requires workload-specific validation&lt;/td&gt;
&lt;td&gt;Entity-level metadata and update mechanisms documented&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser responsiveness&lt;/td&gt;
&lt;td&gt;Sluggish with the tested large drawings&lt;/td&gt;
&lt;td&gt;Sluggish with the tested large drawings&lt;/td&gt;
&lt;td&gt;Comparatively smooth with the tested drawings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overall assessment&lt;/td&gt;
&lt;td&gt;Less suitable for the tested large-drawing workload&lt;/td&gt;
&lt;td&gt;Less suitable for the tested large-drawing workload&lt;/td&gt;
&lt;td&gt;Strongest result in my hands-on comparison&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These results are observations from practical use, not the outcome of a standardized benchmark. Performance can vary depending on file complexity, browser version, hardware, and software release.&lt;/p&gt;

&lt;p&gt;Nevertheless, large-drawing responsiveness is an important product-selection criterion. Successfully opening a drawing is not enough; users must also be able to zoom, select entities, and edit geometry without excessive delays.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.1 CADCraft: A Lightweight Core Still Needs Workload-Specific Optimization
&lt;/h3&gt;

&lt;p&gt;CADCraft's modular Rust architecture and WebAssembly deployment provide a foundation for efficient 2D CAD functionality.&lt;/p&gt;

&lt;p&gt;However, the use of Rust does not automatically eliminate rendering overhead or browser scheduling limitations.&lt;/p&gt;

&lt;p&gt;If complex entities generate substantial display geometry, if rendering data is rebuilt unnecessarily, or if expensive tasks block UI updates, a lightweight application can still struggle with large drawings.&lt;/p&gt;

&lt;p&gt;In my tests, the version of CADCraft I evaluated did not provide the responsiveness I expected when opening and editing large drawings.&lt;/p&gt;

&lt;p&gt;This should not be interpreted as evidence that Rust or WebAssembly is unsuitable for large-scale CAD.&lt;/p&gt;

&lt;p&gt;Rather, it demonstrates that a shared cross-platform core must be accompanied by workload-specific optimization to deliver a consistently responsive browser experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.2 OpenCAD Studio: Desktop Capabilities Do Not Automatically Translate to the Browser
&lt;/h3&gt;

&lt;p&gt;OpenCAD Studio's broader CAD functionality is attractive, particularly for users who need both 2D drafting and selected 3D modeling features.&lt;/p&gt;

&lt;p&gt;However, large-drawing parsing, geometry generation, and data updates can compete for execution time with UI work if they are not appropriately managed.&lt;/p&gt;

&lt;p&gt;In my testing, OpenCAD Studio also showed significant lag when opening and editing large drawings.&lt;/p&gt;

&lt;p&gt;The conclusion is not that the product lacks all performance optimizations, but that its observed behavior in these workloads was less suitable for the large-drawing browser experience I wanted.&lt;/p&gt;

&lt;p&gt;Teams considering OpenCAD Studio should test the browser build with representative production drawings rather than assuming desktop performance will translate directly to the web.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.3 MLightCAD: Performance Engineering Focused on Browser CAD
&lt;/h3&gt;

&lt;p&gt;MLightCAD delivered a noticeably smoother experience in my tests.&lt;/p&gt;

&lt;p&gt;Its published technical material addresses several of the same bottlenecks that commonly affect large browser-based drawings, including geometry batching, text processing, rendering materials, large-coordinate handling, and entity interaction.&lt;/p&gt;

&lt;p&gt;This does not prove that every performance difference is caused by a particular optimization. It does, however, provide a useful technical context for the observed experience.&lt;/p&gt;

&lt;p&gt;The next section examines these engineering approaches in more detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. How MLightCAD Optimizes Large-Drawing Rendering
&lt;/h2&gt;

&lt;p&gt;MLightCAD's published engineering work is particularly relevant because it addresses specific bottlenecks in CAD rendering rather than relying solely on general-purpose graphics abstractions.&lt;/p&gt;

&lt;p&gt;Its technical resources cover geometry batching, custom rendering materials, text-rendering optimizations, entity metadata, large-coordinate rendering, and selection performance.&lt;/p&gt;

&lt;p&gt;These techniques address different stages of the rendering and editing pipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.1 Batched Geometry: Reducing Draw Calls
&lt;/h3&gt;

&lt;p&gt;One of the most important techniques in MLightCAD's rendering architecture is geometry batching.&lt;/p&gt;

&lt;p&gt;A naive renderer may create a separate rendering object for each CAD entity. For a drawing containing tens of thousands of entities, this can produce a large number of individual draw calls.&lt;/p&gt;

&lt;p&gt;MLightCAD's technical documentation describes a batching system that organizes compatible geometry into shared vertex and index buffers while retaining metadata associated with individual entities.&lt;/p&gt;

&lt;p&gt;This approach can reduce the number of draw calls required to render a drawing and limit repeated state changes and buffer-management overhead.&lt;/p&gt;

&lt;p&gt;The benefits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Fewer draw calls for large collections of compatible geometry.&lt;/li&gt;
&lt;li&gt;  Less CPU-side rendering overhead.&lt;/li&gt;
&lt;li&gt;  More efficient reuse of GPU buffers.&lt;/li&gt;
&lt;li&gt;  Entity-level metadata for visibility and updates.&lt;/li&gt;
&lt;li&gt;  A foundation for updating selected geometry without rebuilding everything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The distinction between general-purpose 3D rendering and CAD rendering matters here. CAD drawings contain extensive line and point geometry, so a solution designed specifically around CAD entities can address requirements that generic mesh-batching approaches do not fully cover.&lt;/p&gt;

&lt;p&gt;Technical reference: &lt;a href="https://github.com/mlightcad/cad-viewer/wiki" rel="noopener noreferrer"&gt;MLightCAD CAD Viewer Wiki&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5.2 GPU Shaders for Line Styles and Hatch Patterns
&lt;/h3&gt;

&lt;p&gt;CAD line styles can include dashed and dotted patterns, while hatch entities may contain intricate repeated patterns.&lt;/p&gt;

&lt;p&gt;If every visual effect must be expanded into large amounts of CPU-generated geometry, both memory use and processing time can increase.&lt;/p&gt;

&lt;p&gt;MLightCAD uses custom rendering materials based on Three.js's shader capabilities for certain line and fill effects.&lt;/p&gt;

&lt;p&gt;This allows the GPU to participate directly in producing the required appearance and can reduce some of the overhead associated with generating separate geometry for every visual detail.&lt;/p&gt;

&lt;p&gt;The result depends on the specific entity and rendering path, and shaders do not eliminate all CPU work. Parsing, boundary processing, and geometry preparation may still be necessary.&lt;/p&gt;

&lt;p&gt;Nevertheless, GPU-assisted rendering combined with batching provides a more targeted strategy for complex CAD displays.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.3 Text Rendering and Font Caching
&lt;/h3&gt;

&lt;p&gt;Text-heavy drawings can be particularly demanding.&lt;/p&gt;

&lt;p&gt;MText formatting, SHX stroke fonts, and large numbers of labels introduce processing costs beyond ordinary line rendering.&lt;/p&gt;

&lt;p&gt;MLightCAD's technical resources describe dedicated handling for CAD text and font processing, including caching strategies.&lt;/p&gt;

&lt;p&gt;Caching can reduce repeated resource loading and parsing, particularly when users revisit drawings or reuse the same fonts across multiple sessions.&lt;/p&gt;

&lt;p&gt;Specialized text processing also allows the implementation to address CAD-specific formatting and rendering requirements.&lt;/p&gt;

&lt;p&gt;These details matter because an editor that renders linework quickly can still feel slow if text layout and font processing dominate the loading or redraw pipeline.&lt;/p&gt;

&lt;p&gt;Technical reference: &lt;a href="https://github.com/mlightcad/cad-viewer/wiki" rel="noopener noreferrer"&gt;MLightCAD CAD Viewer Wiki&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5.4 Entity Metadata and Incremental Updates
&lt;/h3&gt;

&lt;p&gt;Rendering performance is only half of the problem. An editor must also remain responsive when a user modifies a drawing.&lt;/p&gt;

&lt;p&gt;MLightCAD's batching architecture retains information about individual entities, including their positions and geometry ranges within shared buffers.&lt;/p&gt;

&lt;p&gt;Its documented approach supports entity-level operations such as adding, updating, removing, and controlling visibility.&lt;/p&gt;

&lt;p&gt;This creates a foundation for more targeted updates.&lt;/p&gt;

&lt;p&gt;For example, when one entity changes, an implementation can identify the affected geometry rather than automatically rebuilding every unrelated object.&lt;/p&gt;

&lt;p&gt;Layer visibility and selected-entity highlighting can also benefit from carefully managed entity metadata.&lt;/p&gt;

&lt;p&gt;Not every edit can be reduced to a small buffer update; complex geometry may still require regeneration.&lt;/p&gt;

&lt;p&gt;The important point is that the rendering architecture provides mechanisms for avoiding unnecessary work across the entire drawing.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.5 Large Coordinates and Entity Selection
&lt;/h3&gt;

&lt;p&gt;Professional drawings may use large world-coordinate values.&lt;/p&gt;

&lt;p&gt;A browser renderer must maintain stable visual output while transforming those coordinates into a viewport suitable for display.&lt;/p&gt;

&lt;p&gt;Selection is another important challenge. An editor needs to identify the intended entity quickly, even when a drawing contains a very large number of objects.&lt;/p&gt;

&lt;p&gt;MLightCAD's published technical resources address large-coordinate rendering and large-scale entity selection as dedicated engineering concerns.&lt;/p&gt;

&lt;p&gt;These capabilities matter because smooth rendering alone does not make an editor practical: users must also be able to select, inspect, and modify objects without frustrating delays.&lt;/p&gt;

&lt;p&gt;Taken together, these optimizations demonstrate a broader design philosophy.&lt;/p&gt;

&lt;p&gt;MLightCAD treats large-drawing performance as a pipeline problem involving geometry, rendering, text, data structures, and interaction—not simply as a question of how fast the GPU can draw a frame.&lt;/p&gt;

&lt;p&gt;Explore the technical topics in the &lt;a href="https://github.com/mlightcad/cad-viewer/wiki" rel="noopener noreferrer"&gt;official CAD Viewer Wiki&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. File Parsing Is as Important as Rendering
&lt;/h2&gt;

&lt;p&gt;A CAD viewer's performance begins before the first entity appears on screen.&lt;/p&gt;

&lt;p&gt;The application must parse the file, construct its drawing representation, resolve relevant entities, and prepare data for rendering.&lt;/p&gt;

&lt;p&gt;If these steps are inefficient, even an excellent rendering engine cannot fully compensate.&lt;/p&gt;

&lt;p&gt;MLightCAD's repository documents different approaches to DWG parsing, including an optional LibreDWG-based converter and a proprietary DWG parser.&lt;/p&gt;

&lt;p&gt;These options involve trade-offs in package size, licensing, deployment, compatibility, and operational requirements.&lt;/p&gt;

&lt;p&gt;The parser is therefore part of the performance architecture.&lt;/p&gt;

&lt;p&gt;A parser that loads a large runtime, uses excessive memory, or struggles with complex entities can create bottlenecks before rendering begins.&lt;/p&gt;

&lt;p&gt;File compatibility and performance must be evaluated together.&lt;/p&gt;

&lt;p&gt;For users working with real engineering drawings, important validation cases include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Large files with many entities.&lt;/li&gt;
&lt;li&gt;  Complex hatch patterns.&lt;/li&gt;
&lt;li&gt;  Extensive text and dimensions.&lt;/li&gt;
&lt;li&gt;  Nested blocks and external references.&lt;/li&gt;
&lt;li&gt;  Different DWG/DXF versions.&lt;/li&gt;
&lt;li&gt;  Repeated editing and save/reopen cycles.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No file extension alone guarantees complete compatibility. The relevant question is how well the application preserves and processes the specific entity types used in the target workflow.&lt;/p&gt;

&lt;p&gt;For implementation details, consult the &lt;a href="https://github.com/mlightcad/cad-viewer" rel="noopener noreferrer"&gt;MLightCAD CAD Viewer repository&lt;/a&gt; and its &lt;a href="https://mlightcad.com/cad-viewer/docs/" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Feature Comparison: Viewing Is Not the Same as Editing
&lt;/h2&gt;

&lt;p&gt;The three products offer overlapping functionality, but their strengths and implementation priorities differ.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Capability&lt;/th&gt;
&lt;th&gt;CADCraft&lt;/th&gt;
&lt;th&gt;OpenCAD Studio&lt;/th&gt;
&lt;th&gt;MLightCAD CAD Viewer&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2D drafting&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DWG/DXF workflows&lt;/td&gt;
&lt;td&gt;Verify version-specific compatibility&lt;/td&gt;
&lt;td&gt;Verify version-specific compatibility&lt;/td&gt;
&lt;td&gt;Supported workflows depend on parser and configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Entity selection and editing&lt;/td&gt;
&lt;td&gt;Available drafting workflows&lt;/td&gt;
&lt;td&gt;Available drafting workflows&lt;/td&gt;
&lt;td&gt;Entity editing supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Layer management&lt;/td&gt;
&lt;td&gt;Supported CAD workflows&lt;/td&gt;
&lt;td&gt;Supported CAD workflows&lt;/td&gt;
&lt;td&gt;Supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Measurement and annotation&lt;/td&gt;
&lt;td&gt;Depends on available tools&lt;/td&gt;
&lt;td&gt;Depends on available tools&lt;/td&gt;
&lt;td&gt;Supported workflows documented&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3D modeling&lt;/td&gt;
&lt;td&gt;Primarily 2D-focused&lt;/td&gt;
&lt;td&gt;Selected 3D modeling capabilities&lt;/td&gt;
&lt;td&gt;Primarily focused on browser-based drawing workflows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser embedding&lt;/td&gt;
&lt;td&gt;Cross-platform application approach&lt;/td&gt;
&lt;td&gt;Cross-platform application approach&lt;/td&gt;
&lt;td&gt;Designed for web application integration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Self-contained HTML export&lt;/td&gt;
&lt;td&gt;Not a primary differentiator&lt;/td&gt;
&lt;td&gt;Not a primary differentiator&lt;/td&gt;
&lt;td&gt;Available for supported sharing and viewing workflows&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Feature availability may vary by release, build, and configuration. DWG/DXF compatibility should be validated using representative production drawings rather than inferred from file extensions alone.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.1 CADCraft: Lightweight 2D Drafting
&lt;/h3&gt;

&lt;p&gt;CADCraft is worth considering when a lightweight 2D CAD environment, shared core logic, and desktop/web availability are the primary requirements.&lt;/p&gt;

&lt;p&gt;Its main appeal is the combination of a lightweight CAD workflow with cross-platform deployment.&lt;/p&gt;

&lt;p&gt;For browser users, however, performance should be evaluated using the size and complexity of the drawings they expect to work with.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.2 OpenCAD Studio: A Broader CAD Environment
&lt;/h3&gt;

&lt;p&gt;OpenCAD Studio is attractive when users need 2D drafting combined with selected 3D modeling features and a general-purpose CAD workspace.&lt;/p&gt;

&lt;p&gt;Its broader scope may be an advantage for users who want a more general CAD environment.&lt;/p&gt;

&lt;p&gt;Teams considering it for browser-based workflows should separately assess loading times, memory consumption, editing responsiveness, and compatibility with complex drawings.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.3 MLightCAD: Browser-Based Editing and Application Integration
&lt;/h3&gt;

&lt;p&gt;MLightCAD is particularly relevant when the requirement is to provide CAD functionality inside a browser-based workflow.&lt;/p&gt;

&lt;p&gt;Its value is not limited to displaying a drawing: users can work with entities and integrate CAD functionality into a broader web product.&lt;/p&gt;

&lt;p&gt;For example, an engineering platform could embed the editor in a project page, associate drawing entities with business records, or provide measurement and annotation tools directly within an online review workflow.&lt;/p&gt;

&lt;p&gt;This is a different product proposition from simply offering a browser build of a standalone CAD application.&lt;/p&gt;

&lt;p&gt;For a detailed feature overview, see the &lt;a href="https://mlightcad.com/cad-viewer/docs/" rel="noopener noreferrer"&gt;MLightCAD CAD Viewer documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Browser Experience, Privacy, and Deployment
&lt;/h2&gt;

&lt;h3&gt;
  
  
  8.1 No Installation Is Only the Beginning
&lt;/h3&gt;

&lt;p&gt;All three products provide browser-based capabilities, so it would be inaccurate to claim that only MLightCAD can run without a desktop installation.&lt;/p&gt;

&lt;p&gt;The more meaningful difference is how each product approaches the browser as its primary environment.&lt;/p&gt;

&lt;p&gt;For users, a browser-based editor reduces installation and update friction. For developers, it can make CAD functionality easier to deliver across operating systems and devices.&lt;/p&gt;

&lt;p&gt;MLightCAD's browser-oriented design is especially attractive when CAD needs to be part of an existing web application rather than a separate destination that users must open and manage.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.2 Client-Side Processing and Data Privacy
&lt;/h3&gt;

&lt;p&gt;MLightCAD emphasizes client-side drawing processing without requiring a dedicated CAD server to convert drawings before display.&lt;/p&gt;

&lt;p&gt;This can reduce network transfer and infrastructure dependencies and may be particularly useful for sensitive engineering documents.&lt;/p&gt;

&lt;p&gt;However, client-side processing should not be confused with a guarantee that an application makes no network requests.&lt;/p&gt;

&lt;p&gt;Remote fonts, resources, file URLs, authentication, or application integrations may still involve network activity.&lt;/p&gt;

&lt;p&gt;Organizations with strict confidentiality requirements should validate actual network behavior and deployment configuration.&lt;/p&gt;

&lt;p&gt;The distinction is that the CAD parsing and rendering workflow can run locally in the browser without uploading the drawing to a dedicated CAD processing service.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.3 Self-Contained HTML and Sharing
&lt;/h3&gt;

&lt;p&gt;MLightCAD also provides a self-contained HTML export workflow intended to make drawings easier to share without requiring recipients to install a conventional CAD application.&lt;/p&gt;

&lt;p&gt;Such a deliverable can be useful for lightweight viewing and review.&lt;/p&gt;

&lt;p&gt;The exported HTML can support viewing workflows such as panning, zooming, layer visibility, and measurement, depending on the export configuration.&lt;/p&gt;

&lt;p&gt;It should not automatically be treated as equivalent to a full editing environment or as a replacement for the original DWG/DXF file.&lt;/p&gt;

&lt;p&gt;For more information, see the &lt;a href="https://github.com/mlightcad/cad-viewer" rel="noopener noreferrer"&gt;official CAD Viewer repository&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.4 Deployment and Integration Comparison
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;CADCraft&lt;/th&gt;
&lt;th&gt;OpenCAD Studio&lt;/th&gt;
&lt;th&gt;MLightCAD CAD Viewer&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Desktop deployment&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Browser-first approach&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser deployment&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser installation requirements&lt;/td&gt;
&lt;td&gt;No conventional desktop installation required&lt;/td&gt;
&lt;td&gt;No conventional desktop installation required&lt;/td&gt;
&lt;td&gt;No conventional desktop installation required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integration into an existing web product&lt;/td&gt;
&lt;td&gt;Depends on exposed interfaces&lt;/td&gt;
&lt;td&gt;Depends on exposed interfaces&lt;/td&gt;
&lt;td&gt;SDK- and component-oriented integration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Client-side drawing processing&lt;/td&gt;
&lt;td&gt;Depends on implementation&lt;/td&gt;
&lt;td&gt;Depends on implementation&lt;/td&gt;
&lt;td&gt;Supported workflows can process drawings in the browser&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dedicated CAD conversion server&lt;/td&gt;
&lt;td&gt;Depends on deployment architecture&lt;/td&gt;
&lt;td&gt;Depends on deployment architecture&lt;/td&gt;
&lt;td&gt;Can reduce the need for a dedicated conversion server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Self-contained drawing sharing&lt;/td&gt;
&lt;td&gt;Not a primary differentiator&lt;/td&gt;
&lt;td&gt;Not a primary differentiator&lt;/td&gt;
&lt;td&gt;Supported HTML export workflow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extensibility&lt;/td&gt;
&lt;td&gt;Depends on project interfaces&lt;/td&gt;
&lt;td&gt;Depends on project interfaces&lt;/td&gt;
&lt;td&gt;Modular integration and extension approach&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Client-side CAD processing can reduce the need for server-side conversion, but a production system may still require backend services for authentication, project management, permissions, auditing, persistence, collaboration, and version history.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Developer Experience: Integrating CAD into Web Applications
&lt;/h2&gt;

&lt;p&gt;For a standalone CAD application, the most important questions may concern drawing compatibility and drafting features.&lt;/p&gt;

&lt;p&gt;For a SaaS product or engineering platform, integration costs can be equally important.&lt;/p&gt;

&lt;p&gt;Developers should evaluate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The availability and stability of public APIs.&lt;/li&gt;
&lt;li&gt;  Control over toolbars, panels, and interaction state.&lt;/li&gt;
&lt;li&gt;  Integration with existing frontend frameworks.&lt;/li&gt;
&lt;li&gt;  Access to drawing entities and their properties.&lt;/li&gt;
&lt;li&gt;  Save, versioning, and permission workflows.&lt;/li&gt;
&lt;li&gt;  Extensibility and customization.&lt;/li&gt;
&lt;li&gt;  The effort required to maintain custom UI adaptations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rust and WebAssembly provide a strong foundation for sharing core logic, but embedding a standalone application into an existing web product can require additional work if the public integration interfaces do not match the host application's needs.&lt;/p&gt;

&lt;p&gt;MLightCAD offers a component- and SDK-oriented integration path. Its architecture is designed to let developers embed CAD functionality into their own web applications and extend the experience with plugins and custom interfaces.&lt;/p&gt;

&lt;p&gt;This is important for larger drawings because responsiveness depends not only on how efficiently geometry is rendered, but also on whether expensive tasks interfere with browser interaction.&lt;/p&gt;

&lt;p&gt;A modular architecture can also let developers choose the level of functionality appropriate to each page. A lightweight review page does not necessarily need the same UI as a full editing environment.&lt;/p&gt;

&lt;p&gt;For teams building web-first products, this can reduce the cost of turning CAD into a reusable application capability.&lt;/p&gt;

&lt;p&gt;Explore the &lt;a href="https://github.com/mlightcad/cad-viewer/wiki" rel="noopener noreferrer"&gt;MLightCAD CAD Viewer Wiki&lt;/a&gt; for architecture, integration, configuration, and API guidance.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Cost, Licensing, and Operational Considerations
&lt;/h2&gt;

&lt;p&gt;Technology selection should account for the complete lifecycle cost, not only the initial software license.&lt;/p&gt;

&lt;p&gt;Relevant factors include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Client-side package size and initialization cost.&lt;/li&gt;
&lt;li&gt;  Server infrastructure requirements.&lt;/li&gt;
&lt;li&gt;  Integration and customization effort.&lt;/li&gt;
&lt;li&gt;  Maintenance across browser versions.&lt;/li&gt;
&lt;li&gt;  File compatibility testing.&lt;/li&gt;
&lt;li&gt;  Security and privacy requirements.&lt;/li&gt;
&lt;li&gt;  Licensing obligations for the core project and its dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  10.1 Cost and Licensing Comparison
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;CADCraft&lt;/th&gt;
&lt;th&gt;OpenCAD Studio&lt;/th&gt;
&lt;th&gt;MLightCAD CAD Viewer&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Initial adoption cost&lt;/td&gt;
&lt;td&gt;Check current project terms&lt;/td&gt;
&lt;td&gt;Check current product terms&lt;/td&gt;
&lt;td&gt;Check current product and SDK terms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Self-hosting&lt;/td&gt;
&lt;td&gt;Depends on license and implementation&lt;/td&gt;
&lt;td&gt;Depends on license and implementation&lt;/td&gt;
&lt;td&gt;Depends on selected components and deployment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Server infrastructure&lt;/td&gt;
&lt;td&gt;Depends on deployment architecture&lt;/td&gt;
&lt;td&gt;Depends on deployment architecture&lt;/td&gt;
&lt;td&gt;Can reduce dedicated CAD conversion requirements&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integration effort&lt;/td&gt;
&lt;td&gt;Depends on required customization&lt;/td&gt;
&lt;td&gt;Depends on required customization&lt;/td&gt;
&lt;td&gt;Designed for web application integration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dependency licensing&lt;/td&gt;
&lt;td&gt;Must be reviewed&lt;/td&gt;
&lt;td&gt;Must be reviewed&lt;/td&gt;
&lt;td&gt;Must be reviewed, especially for DWG parser options&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Production suitability&lt;/td&gt;
&lt;td&gt;Validate performance and compatibility&lt;/td&gt;
&lt;td&gt;Validate performance and compatibility&lt;/td&gt;
&lt;td&gt;Strong candidate for browser-first CAD workloads&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Client-side CAD processing can reduce the need for dedicated conversion services and associated server resources.&lt;/p&gt;

&lt;p&gt;However, a production system may still require backend services for authentication, project management, permissions, auditing, persistence, collaboration, and version history.&lt;/p&gt;

&lt;p&gt;Licensing also requires careful review.&lt;/p&gt;

&lt;p&gt;The MLightCAD CAD Viewer repository is primarily MIT licensed, but DWG parsing options can have different licensing conditions. For example, using a GPL-licensed converter in a commercial distribution can introduce obligations that differ from those associated with a proprietary parser.&lt;/p&gt;

&lt;p&gt;Teams should verify the license of the exact package, dependencies, redistribution model, and deployment architecture they plan to use.&lt;/p&gt;

&lt;p&gt;For a web-first CAD product, the best choice is the one that minimizes total engineering and operational cost while meeting the required performance, compatibility, and feature standards.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Which Product Should You Choose?
&lt;/h2&gt;

&lt;p&gt;The best choice depends on the environment, feature requirements, and drawing sizes that matter most to your users.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requirement&lt;/th&gt;
&lt;th&gt;Recommended Product to Evaluate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Lightweight 2D CAD with cross-platform deployment&lt;/td&gt;
&lt;td&gt;CADCraft&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;General CAD environment with selected 3D modeling features&lt;/td&gt;
&lt;td&gt;OpenCAD Studio&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser-based CAD editing&lt;/td&gt;
&lt;td&gt;MLightCAD CAD Viewer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large-drawing browser workflows&lt;/td&gt;
&lt;td&gt;MLightCAD CAD Viewer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Embedding CAD into an existing web application&lt;/td&gt;
&lt;td&gt;MLightCAD CAD Viewer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reducing dependence on a dedicated CAD conversion server&lt;/td&gt;
&lt;td&gt;MLightCAD CAD Viewer, subject to deployment requirements&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Choose CADCraft If...
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  You want a lightweight 2D CAD application.&lt;/li&gt;
&lt;li&gt;  You value a shared core for desktop and browser deployment.&lt;/li&gt;
&lt;li&gt;  Your drawing sizes and editing requirements are compatible with its current performance.&lt;/li&gt;
&lt;li&gt;  You prefer a straightforward drafting environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Choose OpenCAD Studio If...
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  You want a broader CAD environment.&lt;/li&gt;
&lt;li&gt;  You need selected 3D modeling capabilities alongside 2D drafting.&lt;/li&gt;
&lt;li&gt;  Desktop and browser deployment are both important.&lt;/li&gt;
&lt;li&gt;  Your team can validate its performance against representative production drawings.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Choose MLightCAD CAD Viewer If...
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  Your primary target is the browser.&lt;/li&gt;
&lt;li&gt;  You need actual editing capabilities rather than read-only preview.&lt;/li&gt;
&lt;li&gt;  Large drawings are part of your normal workflow.&lt;/li&gt;
&lt;li&gt;  You want to integrate CAD into an existing web application.&lt;/li&gt;
&lt;li&gt;  You want to reduce dependence on a dedicated CAD conversion server.&lt;/li&gt;
&lt;li&gt;  You value a modular architecture and browser-based deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For demanding browser-based CAD workflows, MLightCAD is the option I would evaluate first.&lt;/p&gt;

&lt;h2&gt;
  
  
  12. Conclusion: If You Need CAD in the Browser, Start with MLightCAD
&lt;/h2&gt;

&lt;p&gt;CADCraft, OpenCAD Studio, and MLightCAD CAD Viewer represent different approaches to bringing CAD functionality to modern users.&lt;/p&gt;

&lt;p&gt;CADCraft focuses on lightweight 2D CAD and a shared cross-platform core. OpenCAD Studio offers a broader CAD environment, including selected 3D modeling capabilities. MLightCAD places greater emphasis on browser-based drawing processing, rendering performance, editing, and integration into web applications.&lt;/p&gt;

&lt;p&gt;For small drawings, the differences between these approaches may not always be obvious.&lt;/p&gt;

&lt;p&gt;With larger engineering files, however, rendering architecture, caching, geometry batching, text handling, incremental updates, and task scheduling can have a substantial impact on the user experience.&lt;/p&gt;

&lt;p&gt;In my hands-on testing, CADCraft and OpenCAD Studio showed significant lag when opening and editing large drawings, while MLightCAD CAD Viewer performed considerably better.&lt;/p&gt;

&lt;p&gt;MLightCAD's published engineering work provides a technical context for that observation, particularly its work on batched geometry, GPU-assisted rendering, text processing, and large-scale entity interaction.&lt;/p&gt;

&lt;p&gt;This is not a claim that MLightCAD will outperform every competitor on every drawing or every device. A rigorous performance ranking requires controlled benchmarks using the same files, hardware, browser versions, and operations.&lt;/p&gt;

&lt;p&gt;Nevertheless, the observed results and documented design priorities make MLightCAD a compelling choice for demanding browser-based CAD workflows.&lt;/p&gt;

&lt;p&gt;The key distinction is not simply whether an application uses Rust, WebAssembly, JavaScript, or WebGL. It is whether its architecture and optimization work address the actual requirements of its target environment.&lt;/p&gt;

&lt;p&gt;If you need a cross-platform standalone CAD application, CADCraft and OpenCAD Studio are both worth evaluating according to your required feature set.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If your goal is to build or use a browser-first CAD editor that can handle large drawings, supports real entity editing, reduces dependence on dedicated CAD conversion servers, and integrates naturally into web applications, MLightCAD CAD Viewer is the stronger choice to evaluate first.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For web CAD, being able to open a drawing is only the starting point.&lt;/p&gt;

&lt;p&gt;The real challenge is making complex drawings practical to work with—and that is where browser-oriented performance engineering makes the difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;p&gt;For readers interested in the implementation details and technical background, here are the official project resources and technical guides.&lt;/p&gt;

&lt;h3&gt;
  
  
  CAD Projects
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;CADCraft — GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/cadcraft-app/cadcraft" rel="noopener noreferrer"&gt;https://github.com/cadcraft-app/cadcraft&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;OpenCAD Studio — Official Website:&lt;/strong&gt; &lt;a href="https://www.opencad.studio/" rel="noopener noreferrer"&gt;https://www.opencad.studio/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;MLightCAD CAD Viewer — GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/mlightcad/cad-viewer" rel="noopener noreferrer"&gt;https://github.com/mlightcad/cad-viewer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;MLightCAD CAD Viewer — Official Documentation:&lt;/strong&gt; &lt;a href="https://mlightcad.com/cad-viewer/docs/" rel="noopener noreferrer"&gt;https://mlightcad.com/cad-viewer/docs/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;MLightCAD — Official Website:&lt;/strong&gt; &lt;a href="https://mlightcad.com/" rel="noopener noreferrer"&gt;https://mlightcad.com/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  MLightCAD Technical Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;CAD Viewer Wiki — Architecture, Rendering, and Developer Guides:&lt;/strong&gt; &lt;a href="https://github.com/mlightcad/cad-viewer/wiki" rel="noopener noreferrer"&gt;https://github.com/mlightcad/cad-viewer/wiki&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Wiki is the central entry point for MLightCAD's published technical material, including its work on rendering optimization, text processing, large-coordinate handling, and entity selection.&lt;/p&gt;

&lt;p&gt;For implementation details, API references, and integration examples, visit the &lt;a href="https://github.com/mlightcad/cad-viewer" rel="noopener noreferrer"&gt;MLightCAD CAD Viewer repository&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Performance observations in this article are based on hands-on testing and should be interpreted in the context of the evaluated software versions and workloads. The technical discussion references publicly described implementation approaches. Exact performance differences should be verified through controlled benchmarks using representative drawings, equivalent hardware, and the same browser environment.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cad</category>
      <category>opensource</category>
      <category>webassembly</category>
      <category>webdev</category>
    </item>
    <item>
      <title>DWG in the Browser? Meet MLightCAD CAD Viewer</title>
      <dc:creator>Mlight Lee</dc:creator>
      <pubDate>Wed, 07 Oct 2026 11:06:54 +0000</pubDate>
      <link>https://dev.to/mlightcad/dwg-in-the-browser-meet-mlightcad-cad-viewer-3oeo</link>
      <guid>https://dev.to/mlightcad/dwg-in-the-browser-meet-mlightcad-cad-viewer-3oeo</guid>
      <description>&lt;p&gt;If you have ever worked with CAD files on the web, you probably know the problem.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;.dwg&lt;/code&gt; or &lt;code&gt;.dxf&lt;/code&gt; file is not just another document format. Unlike images or PDFs, CAD drawings are interactive engineering data containing layers, blocks, dimensions, text, geometry, and many other entities.&lt;/p&gt;

&lt;p&gt;Traditionally, viewing these files means installing a desktop CAD application or uploading the file to a server for processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://mlightcad.com/" rel="noopener noreferrer"&gt;MLightCAD&lt;/a&gt; CAD Viewer takes a different approach: open and interact with DWG/DXF files directly in the browser.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No CAD application.&lt;/li&gt;
&lt;li&gt;No backend server.&lt;/li&gt;
&lt;li&gt;No file upload required.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project is open source and available on GitHub under the MIT license.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcg7jdfimfocpxvaaxpz5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcg7jdfimfocpxvaaxpz5.jpg" alt="MLightCAD CAD Viewer" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is MLightCAD CAD Viewer?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://mlightcad.com/cad-viewer/cad-viewer/" rel="noopener noreferrer"&gt;MLightCAD CAD Viewer&lt;/a&gt;&lt;/strong&gt; is a web-based DWG/DXF viewer and editor designed to bring CAD workflows into the browser.&lt;/p&gt;

&lt;p&gt;It can load, parse, render, and interact with CAD drawings entirely on the client side. This makes it possible to build CAD-related web applications without maintaining a dedicated CAD processing server.&lt;/p&gt;

&lt;p&gt;It is also designed to be more than just an online file viewer.&lt;/p&gt;

&lt;p&gt;You can use it as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A standalone DWG/DXF viewer&lt;/li&gt;
&lt;li&gt;A Vue 3 component inside your own application&lt;/li&gt;
&lt;li&gt;A CAD visualization SDK&lt;/li&gt;
&lt;li&gt;A component embedded into another website or application&lt;/li&gt;
&lt;li&gt;An offline CAD viewer&lt;/li&gt;
&lt;li&gt;A foundation for building browser-based CAD applications&lt;/li&gt;
&lt;li&gt;A command-line workflow for processing CAD drawings&lt;/li&gt;
&lt;li&gt;A portable single-file CAD review application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Make CAD data as accessible on the web as other digital content.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/n2o3Osc2_NQ" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Open a DWG or DXF Directly in Your Browser
&lt;/h2&gt;

&lt;p&gt;The most important feature is also the simplest one.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Drop a DWG or DXF file into the viewer and start working with it.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There is no need to first convert the drawing into SVG, PDF, PNG, or another intermediate format. The browser handles the CAD data directly. This is particularly useful when building applications where CAD drawings are just one part of a larger workflow.&lt;/p&gt;

&lt;p&gt;For example, imagine a construction management application where users need to inspect floor plans, or a manufacturing platform where users need to preview engineering drawings associated with a part.&lt;/p&gt;

&lt;p&gt;Instead of asking users to download the drawing and open it with another application, the drawing can simply become part of the web application.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Familiar CAD Experience
&lt;/h2&gt;

&lt;p&gt;MLightCAD CAD Viewer is not designed to be just a canvas displaying some lines. It provides many of the interactions that CAD users expect.&lt;/p&gt;

&lt;h3&gt;
  
  
  Navigation
&lt;/h3&gt;

&lt;p&gt;Users can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zoom in and out&lt;/li&gt;
&lt;li&gt;Pan around the drawing&lt;/li&gt;
&lt;li&gt;Zoom to extents&lt;/li&gt;
&lt;li&gt;Select drawing entities&lt;/li&gt;
&lt;li&gt;Navigate large drawings interactively&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The interaction model is designed to feel familiar to people who already work with CAD software. It also supports touch interaction, making the viewer suitable for tablets and mobile devices.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer Management
&lt;/h3&gt;

&lt;p&gt;CAD drawings often contain hundreds of layers.&lt;/p&gt;

&lt;p&gt;The viewer provides a layer management interface that allows users to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Show or hide layers&lt;/li&gt;
&lt;li&gt;Inspect layer information&lt;/li&gt;
&lt;li&gt;Focus on specific parts of a drawing&lt;/li&gt;
&lt;li&gt;Work with drawings containing complex layer structures&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes it much more useful for real engineering drawings than a simple geometry renderer.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/nFiNpXnUFZI" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Measurement
&lt;/h3&gt;

&lt;p&gt;The viewer also provides measurement capabilities for reviewing drawings. For example, users can measure distances directly on the drawing without exporting it to another application.&lt;/p&gt;

&lt;p&gt;The goal is not to replace a full desktop CAD system, but to provide the essential tools needed for &lt;strong&gt;viewing, reviewing, inspecting, and sharing drawings on the web&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/zWLs1TCtyBg" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  CAD-Style Command Line
&lt;/h3&gt;

&lt;p&gt;For users who are comfortable with AutoCAD-style workflows, CAD Viewer also includes a command-line interface. This provides an interesting bridge between traditional CAD applications and modern web applications. Instead of treating CAD as an unfamiliar web canvas, the project brings some familiar CAD concepts into the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designed for Large CAD Drawings
&lt;/h2&gt;

&lt;p&gt;One of the biggest challenges in browser-based CAD is performance. A CAD drawing can contain tens of thousands, hundreds of thousands, or even millions of graphical elements. Rendering every entity independently would quickly become expensive in a WebGL environment.&lt;/p&gt;

&lt;p&gt;MLightCAD CAD Viewer therefore puts significant effort into efficient rendering and geometry batching. The result is a viewer designed to remain interactive even when working with relatively large and complex drawings.&lt;/p&gt;

&lt;p&gt;This matters because a browser-based CAD viewer is only useful if it remains responsive when users open the drawings they actually use in production.&lt;/p&gt;

&lt;p&gt;Performance is therefore treated as a core part of the architecture rather than an optimization added later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Privacy by Design
&lt;/h2&gt;

&lt;p&gt;One of the most interesting consequences of browser-side CAD processing is privacy. When a user opens a drawing locally, the file does not have to be uploaded to a remote CAD processing service. This is important for engineering organizations. CAD drawings can contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product designs&lt;/li&gt;
&lt;li&gt;Manufacturing information&lt;/li&gt;
&lt;li&gt;Building layouts&lt;/li&gt;
&lt;li&gt;Mechanical details&lt;/li&gt;
&lt;li&gt;Customer information&lt;/li&gt;
&lt;li&gt;Proprietary engineering data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For many organizations, sending such files to an external server simply to generate a preview is undesirable or even impossible. With browser-side processing, applications can keep the drawing on the user's machine.&lt;/p&gt;

&lt;p&gt;This also makes CAD Viewer suitable for environments where network access is limited or completely unavailable.&lt;/p&gt;

&lt;h2&gt;
  
  
  From Online Viewer to Offline CAD Application
&lt;/h2&gt;

&lt;p&gt;There is another interesting capability that comes from this architecture. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A drawing can be exported into a &lt;strong&gt;single self-contained HTML file&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The resulting file contains the drawing data together with the viewer runtime. You can send that HTML file to someone else. They can open it in a modern browser without installing CAD software, running a server, or connecting to your application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Want to try it yourself? You can use &lt;a href="https://mlightcad.com/cad-viewer/cad-simple-viewer/html-converter.html" rel="noopener noreferrer"&gt;the DWG to HTML Converter&lt;/a&gt; to convert a DWG file into a self-contained HTML file directly in your browser.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The recipient can still:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the drawing&lt;/li&gt;
&lt;li&gt;Pan and zoom&lt;/li&gt;
&lt;li&gt;Control layers&lt;/li&gt;
&lt;li&gt;Inspect the drawing&lt;/li&gt;
&lt;li&gt;Measure distances&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This turns a CAD drawing into a portable web document. Think about sending a CAD drawing to a customer.&lt;/p&gt;

&lt;p&gt;Instead of saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Please install this CAD viewer."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;you can simply send:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Open this HTML file."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This can also be useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Design reviews&lt;/li&gt;
&lt;li&gt;Project archives&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;li&gt;Customer communication&lt;/li&gt;
&lt;li&gt;Offline environments&lt;/li&gt;
&lt;li&gt;Air-gapped environments&lt;/li&gt;
&lt;li&gt;Long-term drawing archives&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/yYUY5dZeVVU" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Embed CAD into Your Website with One Line of Code
&lt;/h2&gt;

&lt;p&gt;You don't even need to build a CAD application from scratch. MLightCAD CAD Viewer can also be embedded directly into an existing website or web application. In many cases, you can add a DWG/DXF viewer with just a single line of HTML code.&lt;/p&gt;

&lt;p&gt;For example, an application can simply embed the viewer as an iframe:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt;
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://mlightcad.com/iframe-plugin.html?url=YOUR_DWG_OR_DXF_URL"&lt;/span&gt;
  &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"100%"&lt;/span&gt;
  &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"600"&lt;/span&gt;
  &lt;span class="na"&gt;frameborder=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes it possible to add CAD viewing capabilities to websites, documentation systems, project management platforms, CMSs, customer portals, or internal engineering applications without implementing a CAD rendering engine yourself.&lt;/p&gt;

&lt;p&gt;You can try the one-line DWG/DXF embedding experience here: &lt;a href="https://mlightcad.com/iframe-plugin.html" rel="noopener noreferrer"&gt;MLightCAD IFrame Plugin&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ut70lqfrpz2o411akrr.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ut70lqfrpz2o411akrr.webp" alt="iframe plugin" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The idea is simple: your application provides the CAD file, and MLightCAD provides the CAD viewing experience. This makes CAD content much easier to integrate into the web.&lt;/p&gt;

&lt;h2&gt;
  
  
  CAD on Any Website
&lt;/h2&gt;

&lt;p&gt;Another important aspect of CAD Viewer is that it does not have to be used as a standalone application.&lt;/p&gt;

&lt;p&gt;It can be integrated into an existing web application.&lt;/p&gt;

&lt;p&gt;For example, you could have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your Application
       │
       ├── Project Management
       ├── Documents
       ├── BOM
       ├── Engineering Data
       │
       └── MLightCAD CAD Viewer
                │
                ├── DWG
                └── DXF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes CAD drawings another type of content inside your application.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A project management system can display its engineering drawings.&lt;/li&gt;
&lt;li&gt;A document management system can preview DWG files.&lt;/li&gt;
&lt;li&gt;A manufacturing platform can display drawings next to product information.&lt;/li&gt;
&lt;li&gt;A collaboration system can provide drawing review without requiring users to leave the application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And because the viewer runs in the browser, the integration can remain entirely web-based.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Sources Are Not Limited to Local Files
&lt;/h2&gt;

&lt;p&gt;The viewer can also be integrated with different data sources.&lt;/p&gt;

&lt;p&gt;A DWG/DXF file does not necessarily have to come from a local file picker.&lt;/p&gt;

&lt;p&gt;It can come from a web application, cloud storage, document management system, or another data source.&lt;/p&gt;

&lt;p&gt;This makes it possible to build integrations such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CAD files stored in OneDrive&lt;/li&gt;
&lt;li&gt;CAD files stored in Google Drive&lt;/li&gt;
&lt;li&gt;CAD drawings inside a document management system&lt;/li&gt;
&lt;li&gt;CAD previews inside collaboration platforms&lt;/li&gt;
&lt;li&gt;CAD drawings inside CMS systems&lt;/li&gt;
&lt;li&gt;CAD files served from your own API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, you can try opening DWG/DXF drawings directly from your OneDrive using the &lt;a href="https://mlightcad.com/onedrive/" rel="noopener noreferrer"&gt;MLightCAD OneDrive integration&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The viewer becomes the CAD rendering layer, while your application decides where the CAD data comes from.&lt;/p&gt;

&lt;p&gt;This separation is important because it means you don't need to build a CAD engine every time you want to add CAD support to a product.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build Your Own CAD Application
&lt;/h2&gt;

&lt;p&gt;For developers, CAD Viewer can be used at different levels. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you simply need a ready-to-use viewer, you can use the complete application.&lt;/li&gt;
&lt;li&gt;If you are building a Vue 3 application, you can integrate the CAD viewer as a component.&lt;/li&gt;
&lt;li&gt;And if you want more control, the project also provides lower-level building blocks for creating your own CAD experiences.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This opens the door to applications such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Online CAD viewers&lt;/li&gt;
&lt;li&gt;CAD review systems&lt;/li&gt;
&lt;li&gt;Engineering document platforms&lt;/li&gt;
&lt;li&gt;Construction management applications&lt;/li&gt;
&lt;li&gt;Manufacturing platforms&lt;/li&gt;
&lt;li&gt;CAD collaboration tools&lt;/li&gt;
&lt;li&gt;CAD asset management systems&lt;/li&gt;
&lt;li&gt;Digital twins&lt;/li&gt;
&lt;li&gt;GIS/CAD applications&lt;/li&gt;
&lt;li&gt;AI-assisted CAD tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important idea is that the viewer does not have to be the final product.&lt;/p&gt;

&lt;p&gt;It can be the &lt;strong&gt;CAD engine inside another product&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Web-Native CAD Ecosystem
&lt;/h2&gt;

&lt;p&gt;This is perhaps the larger vision behind MLightCAD CAD Viewer.&lt;/p&gt;

&lt;p&gt;The project is not trying to recreate the entire desktop CAD world inside a browser overnight.&lt;/p&gt;

&lt;p&gt;Instead, it provides a foundation for bringing CAD data into the web.&lt;/p&gt;

&lt;p&gt;The architecture allows different pieces of the ecosystem to evolve independently:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CAD data → CAD model → rendering → interaction → application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That means developers can build specialized experiences on top of the same CAD foundation.&lt;/p&gt;

&lt;p&gt;One application might focus on document preview.&lt;/p&gt;

&lt;p&gt;Another might focus on engineering review.&lt;/p&gt;

&lt;p&gt;Another might focus on measurement.&lt;/p&gt;

&lt;p&gt;Another might integrate CAD with GIS.&lt;/p&gt;

&lt;p&gt;Another might use CAD data as part of an AI workflow.&lt;/p&gt;

&lt;p&gt;The CAD viewer becomes infrastructure rather than just an application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command Line and Automation
&lt;/h2&gt;

&lt;p&gt;CAD Viewer is also useful outside the browser UI.&lt;/p&gt;

&lt;p&gt;The project provides command-line tooling for CAD-related workflows.&lt;/p&gt;

&lt;p&gt;For example, CAD drawings can be processed in batches and converted into images or other web-friendly representations.&lt;/p&gt;

&lt;p&gt;This can be useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generating previews&lt;/li&gt;
&lt;li&gt;Creating thumbnails&lt;/li&gt;
&lt;li&gt;Building document indexes&lt;/li&gt;
&lt;li&gt;Preparing datasets&lt;/li&gt;
&lt;li&gt;Automating CAD workflows&lt;/li&gt;
&lt;li&gt;Preparing data for AI/ML applications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is particularly interesting as CAD increasingly becomes part of automated and AI-driven workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Browser-Based CAD Matters
&lt;/h2&gt;

&lt;p&gt;The web has changed how we work with almost every other type of content.&lt;/p&gt;

&lt;p&gt;We can open documents in a browser.&lt;/p&gt;

&lt;p&gt;We can edit images in a browser.&lt;/p&gt;

&lt;p&gt;We can collaborate on spreadsheets in a browser.&lt;/p&gt;

&lt;p&gt;We can review videos in a browser.&lt;/p&gt;

&lt;p&gt;But CAD has remained heavily tied to desktop software.&lt;/p&gt;

&lt;p&gt;There are good reasons for this. CAD files are complicated, and high-performance rendering is difficult.&lt;/p&gt;

&lt;p&gt;But modern browsers now provide technologies such as WebAssembly, WebGL, Web Workers, and increasingly powerful JavaScript runtimes.&lt;/p&gt;

&lt;p&gt;These technologies make a different model possible.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CAD File
   ↓
Upload to Server
   ↓
CAD Processing
   ↓
Server Rendering
   ↓
Browser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CAD File
   ↓
Browser
   ├── Parse
   ├── Process
   ├── Render
   └── Interact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That changes the architecture of web-based CAD applications.&lt;/p&gt;

&lt;p&gt;It can reduce server infrastructure, improve privacy, support offline scenarios, and make CAD much easier to embed into existing web products.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open Source
&lt;/h2&gt;

&lt;p&gt;MLightCAD CAD Viewer is open source and released under the MIT license.&lt;/p&gt;

&lt;p&gt;The project is available on GitHub and welcomes developers who want to experiment with browser-based CAD.&lt;/p&gt;

&lt;p&gt;If you are building something around DWG/DXF, you don't necessarily need to start by implementing a CAD engine from scratch.&lt;/p&gt;

&lt;p&gt;You can start with a working browser-based CAD foundation and build your own application around it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;The current viewer is only one step toward a broader vision.&lt;/p&gt;

&lt;p&gt;The direction is to gradually move from:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CAD Viewer → CAD Review → CAD Editing → CAD Applications&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and eventually connect CAD with other parts of the modern software ecosystem.&lt;/p&gt;

&lt;p&gt;That includes cloud storage, document management, collaboration, AI, GIS, mobile applications, and offline workflows.&lt;/p&gt;

&lt;p&gt;The interesting part is not simply putting AutoCAD drawings into a browser.&lt;/p&gt;

&lt;p&gt;It is making &lt;strong&gt;CAD data a first-class citizen of the web&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;If you work with DWG/DXF files or are building a web application that needs CAD support, give MLightCAD CAD Viewer a try.&lt;/p&gt;

&lt;p&gt;You can explore the source code, run the demo, or integrate the viewer into your own application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/mlightcad/cad-viewer" rel="noopener noreferrer"&gt;&lt;code&gt;mlightcad/cad-viewer&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're building something interesting with it, I'd love to hear about it.&lt;/p&gt;

&lt;p&gt;And if you have ideas, feature requests, or integration scenarios, feel free to open an issue or start a discussion.&lt;/p&gt;

&lt;p&gt;The future of CAD may not be another desktop application.&lt;/p&gt;

&lt;p&gt;It might be the browser.&lt;/p&gt;

</description>
      <category>cad</category>
      <category>opensource</category>
      <category>webgl</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
