Skip to main content

Beyond Chatbots: LLMs in the Mechanical Engineering Workflow

ยท 3 min read
Yurii
CAD Automation Engineer

We often hear about AI generating images or poetry. But for mechanical engineers and CAD designers, Large Language Models (LLMs) are not about creativity-they are about interface and automation.

In this article, we look at how to use LLMs (GPT-4, Claude 3.5, Llama 3) to control CAD software and process technical data.

The Core Concept

LLMs are poor at spatial reasoning (they can't "imagine" a 3D assembly well). However, they are excellent at understanding the APIs of CAD software (SolidWorks, AutoCAD, Fusion 360) and writing the scripts to manipulate that geometry.

  1. Zero-Shot Macro Generation

The biggest friction in CAD automation is looking up API documentation. Writing a VBA macro for SolidWorks or a Python script for Blender used to take hours of searching forums.

Modern LLMs have indexed these API docs. You can now prompt for functionality rather than syntax.

Real-world Use Case: Batch export all sheet metal components from an assembly to DXF.

Code Example (Python + pyautocad)

Instead of writing this from scratch, an engineer can generate this boilerplate instantly:

from pyautocad import Autocad, APoint

# Generated by LLM to automate repetitive drawing tasks
def draw_gear_profile(teeth, module):
acad = Autocad(create_if_not_exists=True)
radius = (teeth * module) / 2
center = APoint(0, 0)

# LLM understands specific engineering libraries
acad.model.AddCircle(center, radius)
print(f"Gear profile created: m{module} z{teeth}")

draw_gear_profile(20, 2)
  1. Parsing Legacy Data (PDF to JSON)

Engineers deal with thousands of PDF datasheets and legacy 2D drawings. Extracting parameters (tolerance, material, weight) manually is error-prone.

Multimodal LLMs can "read" screenshots of technical drawings or tables and structure that data into JSON for your ERP or PDM system.

  1. RAG for Standards (ISO/GOST/DIN)

Instead of flipping through a 500-page PDF to find the bolt torque specification for an M12 grade 8.8 screw, you can build a RAG (Retrieval-Augmented Generation) system.

Input: "Torque for M12 8.8"

System: Retrieves specific page from uploaded ISO PDF.

Output: "81 Nm (Source: ISO 898-1, Table 4)"

Interactive Prompt Builder

Try this structure when asking an AI to write CAD scripts for you:

Prompt structure

Context: "I am using SolidWorks 2023 API with VBA."

Task: "Write a macro that traverses the feature tree."

Constraint: "Identify all features with 'suppressed' state and unsuppress them."

Summary

Don't ask the AI to design the part. Ask the AI to write the code that automates the boring parts of the design process. This shifts the engineer's role from "operator" to "architect of automation."

LinkedInGitHub