Large Language Models for CAD: Automating Script-Based Modeling in Practice

    Large language models are moving from conversation and writing toward understanding and operating the physical world. This article examines how LLMs can drive CAD (computer-aided design) modeling through script generation, exploring why scripts serve as the practical interface between natural language and geometry, the technical pipeline for generating and running modeling scripts, a layered system architecture, deployment priorities, and value metrics. It is written for industrial software developers and enterprise technical decision-makers who want to understand the core problems, system design, and evolution path of LLM-driven CAD, and how such systems connect human intent to the manufacturing world through deterministic geometry kernels.

    1. Introduction: For LLMs to Enter the Physical World, They Must First “Read and Operate” Geometry

    As we move through 2026, the center of competition for large language models is shifting from “conversation and writing” to “understanding and operating the real world.” Embodied intelligence, robot control, and industrial simulation are all exploring the same question: how to turn a model’s semantic understanding into executable operations on physical objects.

    CAD is the cornerstone of the industrial system. From a single screw or a circuit board to whole-machine assembly and factory floor layout, virtually every physical entity begins as a geometric description created during the design stage. Building intelligent capabilities around CAD therefore carries a dual significance:

    • Upward, it is the “first door” through which LLMs move from language space into physical space;
    • Downward, it connects simulation, process planning, manufacturing, and operations, serving as the data source that runs through the entire product lifecycle.

    After a recent release of an AI coding tool, much of the discussion focused on a seemingly minor but critical capability change: the model can write and run CAD modeling scripts to build and refine assets, modify individual components, and adjust geometry, materials, and scene layout. If this can be reproduced reliably in engineering practice, it signals that the value of LLMs in professional design software is shifting from “assisted Q&A” to “directly producing design results.”

    This article does not evaluate any specific product. Instead, starting from technical principles, it systematically discusses the core problems, system architecture, deployment paths, and evolution directions involved in “how LLMs drive CAD modeling,” for the reference of industrial software developers and enterprise technical decision-makers.

    2. Why Scripts: The Key “Interface” in the CAD Automation Chain

    2.1 From Interactive Commands to Programmable Scripts

    CAD has been tied to “automation” since its inception, evolving through roughly three stages:

    1. Interactive command stage: Engineers enter instructions one at a time through menus, toolbars, and command lines, such as drawing a line, extruding, or drilling a hole. Graphical interfaces lowered the learning curve, but operations remained step-by-step commands issued by a human to a machine.
    2. Parametric and script stage: Parametric modeling turned geometric constraints into solvable systems of equations. Mechanisms such as modeling scripts and feature macros then emerged, allowing repetitive modeling workflows to be captured as programs and executed in batches.
    3. Natural-language-driven stage: LLMs take on the work of translating and orchestrating “natural language → structured intent → modeling script,” shifting humans from “commanding the machine” to “describing goals and reviewing results.”

    2.2 Why Scripts Are the Right Connecting Layer

    Among the many technical paths, “the model generates scripts, and CAD executes them” is currently the most engineering-feasible option, for five reasons:

    • Symbolic expression: Scripts are built from variables, functions, and deterministic workflows, making them a discrete symbolic system highly isomorphic to the code tasks LLMs handle well. Compared with directly generating meshes or surfaces in continuous geometric space, generating scripts is easier to constrain, validate, and debug.
    • Control and reproducibility: The same script plus the same set of parameters should yield a deterministic result. This reduces “requirement changes” to “parameter adjustments” and lays the foundation for automated regression testing.
    • Atomic editing: Scripts operate at the granularity of features, parts, and assemblies, supporting modification of a single component without rebuilding the entire model. This is especially important for assemblies that are structurally complex and tightly interconnected.
    • Safety sandbox: Scripts run in a controlled environment where permissions and reachable resources can be precisely limited. Compared with letting a model directly invoke various design operations, the script approach offers a clearer risk boundary.
    • Asset accumulation: The script itself is a carrier of “design knowledge.” A mature template often embodies decades of an organization’s design experience; reusing templates is more reliable than generating from scratch each time, and easier to turn into a positive feedback loop.

    Of course, scripts are not a panacea. For freeform surfaces, complex surface transitions, and fine reverse engineering, the expressiveness and stability of scripts remain limited. At this stage, it is better to start with “template + parametric” standard parts and parts with clearly defined rules.

    2.3 Task Types: From “Expressing Intent” to “Executing Intent”

    To facilitate discussion, the design tasks a model handles can be divided into three layers:

    Layer Typical tasks Output
    Expression Read natural-language requirements and multimodal material such as drawings, sketches, and point clouds Structured design intent
    Orchestration Decompose intent into an ordered sequence of operations, select templates, arrange assembly relationships Modeling plan / script
    Execution Run scripts in CAD or the geometry kernel to materialize geometry, materials, and layout Usable design result

    These three layers have different levels of maturity: the expression layer determines “whether it can understand,” the orchestration layer determines “whether it can plan,” and the execution layer determines “whether it can be delivered.” In engineering practice, it is often the constraints of the execution layer (geometric validity, assembly interference, computational performance) that determine whether an approach can scale.

    3. Technical Breakdown: How LLMs Generate and Run Modeling Scripts

    3.1 Intent Parsing: From Natural Language to Structured Description

    The model must first turn vague human descriptions into a machine-computable structured representation. Take the example “move the four mounting holes on a support plate outward by 10 mm and add a 2 mm fillet to the edge,” which involves at least:

    • Object localization: which features the four mounting holes refer to;
    • Parameter changes: the hole-position offset and the fillet radius;
    • Constraint validation: whether the move conflicts with adjacent features or boundaries.

    In practice, a combination of “prompt constraints + structured output + rule validation” is usually adopted: the model outputs a typed parameter table, and the program validates its legality and consistency.

    1. {
    2. "operation": "modify_feature",
    3. "target": {
    4. "part": "mounting_plate",
    5. "feature_type": "hole_pattern",
    6. "selector": {"count": 4, "role": "mounting"}
    7. },
    8. "changes": [
    9. {"param": "offset_x", "mode": "relative", "value": 10, "unit": "mm"},
    10. {"param": "edge_fillet", "mode": "absolute", "value": 2, "unit": "mm"}
    11. ],
    12. "constraints": ["keep_symmetric", "no_collision_with_frame"],
    13. "units": "mm"
    14. }
    1. # Illustrative pseudocode: validates parameter types, value ranges, and
    2. # constraint logic only. It is independent of any specific CAD software
    3. # or geometry kernel.
    4. def apply_change(state, op):
    5. if op["operation"] != "modify_feature":
    6. raise UnsupportedOperation(op)
    7. target = state.find_part(op["target"]["part"])
    8. features = target.select(op["target"]["feature_type"], op["target"]["selector"])
    9. for ch in op["changes"]:
    10. if not unit_ok(ch["value"], ch["unit"]): # unit check
    11. raise ValidationError("unit mismatch")
    12. if not within_range(ch["param"], ch["value"]): # value range check
    13. raise ValidationError("parameter out of design range")
    14. candidate = clone(state) # trial on a copy so the original design stays untouched
    15. for f in features:
    16. f.offset(dx=relative(candidate, op, "offset_x"), dy=0, dz=0)
    17. f.fillet(r=absolute(op, "edge_fillet"))
    18. for rule in op["constraints"]: # constraint check
    19. if not check_rule(candidate, rule):
    20. raise ValidationError(f"constraint not satisfied: {rule}")
    21. return candidate

    3.2 Geometric Constraints: Rules the LLM Must “Understand”

    Generating a syntactically correct script is not difficult; generating a script that is geometrically sound and feasible for assembly is. CAD modeling relies on a parametric geometry kernel that is fundamentally a rigorous system of “constraint solving + boolean operations + feature history.” The model must at least align with the following types of constraints:

    • Topological constraints: solids must be closed and manifold, with no self-intersection, dangling edges, zero-thickness faces, or degenerate features;
    • Dimensional constraints: a hole diameter cannot exceed the plate width, a fillet radius cannot exceed the length of the adjacent edge, and slot widths must meet process minimums;
    • Assembly constraints: holes concentric with shafts, faces mated, gears meshed; moving one part must not cause interference;
    • Manufacturing constraints: minimum wall thickness, draft angles, and tool accessibility, which determine whether the model can actually be manufactured;
    • Design intent: information about “why it was drawn this way,” such as symmetry, datums, and dimension chains, which often does not appear explicitly in the geometry.

    Mature design software has long固化 these rules in its geometry kernel and constraint solver. So a more reasonable division of labor is: the LLM handles “understanding and planning,” while the geometry kernel handles “judgment and solving.” Every operation the model outputs should be validated by the kernel, and even previewed within the kernel, rather than directly generating final geometry.

    3.3 Multi-Round Loop: Generate → Execute → Validate → Refine

    Reliable script generation rarely “gets it right on the first try” and usually requires an iterative loop:

    1. Generate: the model produces a candidate script based on requirements, historical templates, and the existing model structure;
    2. Execute: run the script in a sandbox to obtain geometric results, kernel errors, or render snapshots;
    3. Validate: use geometric validation, a rules engine, and render comparison to assess whether the candidate meets requirements;
    4. Refine: feed error messages, validation conclusions, or visual differences back to the model so it can fix the script and retry.
    1. # Illustrative pseudocode: shows the "generate-execute-validate-refine" iteration loop.
    2. MAX_ROUNDS = 5
    3. def solve_design(spec_text, reference_images=None):
    4. intent = parse_intent(spec_text) # natural language -> structured intent
    5. plan = plan_operations(intent) # intent -> ordered operation sequence
    6. script = compile_script(plan) # plan -> executable modeling script
    7. for round_index in range(MAX_ROUNDS):
    8. result = sandbox_run(script) # run in an isolated environment, exposing only necessary permissions
    9. if not result.ok:
    10. script = repair_script(script, result.error_trace)
    11. continue
    12. model = load_geometry(result.output)
    13. validation = validate_geometry(model) # geometry checks: topology/manifold/self-intersection/volume/interference
    14. if reference_images:
    15. similarity = compare_render(model, reference_images) # visual comparison against reference views
    16. else:
    17. similarity = 1.0
    18. if validation.passed and similarity >= THRESHOLD:
    19. return script, model # hand back to engineers for review, then store
    20. # Translate "what is wrong and why" into feedback the model can understand
    21. feedback = describe_findings(validation, similarity, round_index)
    22. script = refine_script(script, feedback)
    23. return escalate_to_human(script, intent) # not converged after several rounds: escalate to a human

    The key to this loop is “the quality of the feedback”: returning only “validation failed” is far from enough. The failure reason should be told to the model in a structured way, for example, “the fillet radius of the third feature is larger than the adjacent edge length; it should not exceed 1.8 mm.” The more specific the feedback, the faster it converges and the lower the trial-and-error cost.

    3.4 Execution and Performance: The Model Must Not “Get Stuck” in the Modeling Engine

    Script execution is a compute-intensive task: boolean operations on complex assemblies, geometry reconstruction, and high-quality rendering can take anywhere from seconds to minutes. Synchronous waiting produces a poor experience, and long tasks can overwhelm the service. Common engineering practices include:

    • Asynchronous tasks: package script execution as background tasks, queue and distribute them across compute nodes, and let the front end obtain results via progress or completion notifications;
    • Layered execution: first run lightweight rule validation and parameter-legality checks, and only then enter the heavier geometric solving and rendering;
    • Caching and incremental computation: cache template parameter combinations and common standard parts; for local modifications, recompute only the affected features;
    • Elastic compute: place heavy workloads such as rendering and simulation on container platforms that scale on demand, expanding automatically at peaks and shrinking automatically at troughs.
    1. # Illustrative pseudocode: submits and tracks a modeling script as an asynchronous job.
    2. def submit_script_job(script, params, policy):
    3. precheck = quick_validate(script, params) # quick check: syntax, parameters, basic geometry rules
    4. if not precheck.ok:
    5. return {"status": "rejected", "reasons": precheck.issues}
    6. task_id = task_queue.enqueue( # enqueue for asynchronous execution
    7. payload={"script": script, "params": params},
    8. priority=policy.priority,
    9. timeout=policy.timeout_seconds,
    10. retry=policy.max_retries
    11. )
    12. return {"status": "queued", "task_id": task_id}
    13. def poll_result(task_id):
    14. record = job_store.get(task_id) # poll task status
    15. if record.status == "failed":
    16. return {"status": "failed", "error": record.error}
    17. if record.status != "done":
    18. return {"status": record.status, "progress": record.progress}
    19. return {"status": "done", "model": record.artifact_ref} # return only the artifact reference

    3.5 Multimodal Input: Reading Drawings, Point Clouds, and Field Material

    Real-world design input goes far beyond text:

    • Engineering drawings: containing views, dimension annotations, tolerances, and technical requirements;
    • Scanned point clouds: the base data for reverse-modeling existing physical objects;
    • Field photos: common reference material in retrofit and maintenance scenarios;
    • Existing models: historical assets that need local modification on an existing structure.

    The value of multimodal LLMs lies in mapping this heterogeneous information into the same set of geometric semantics. For example, generating an initial model of a standard part from a hand-drawn sketch and a dimension table, then judging from a field photo whether the installation space is sufficient. Two points deserve emphasis in practice:

    • Precision awareness: errors in drawing recognition get amplified by subsequent geometric operations, so critical dimensions must be confirmed manually or re-checked by rules;
    • Context management: the drawings and models of a large assembly contain enormous amounts of information, so retrieval, layered summarization, and divide-and-conquer planning are needed to control input size.

    3.6 Divide and Conquer with Long Context: “Decompose–Fill–Validate” for Complex Assemblies

    A complete assembly may contain hundreds or thousands of parts and mating relationships, and generating them all at once often fails to converge. A more robust strategy is to process them in layers:

    1. Skeleton first: determine the overall layout, datums, and primary interfaces;
    2. Part filling: generate part scripts one by one or in batches, reusing standard-part templates;
    3. Assembly validation: check mating relationships, interference, and motion clearances;
    4. Local refinement: feed validation issues back to the generation stage of the corresponding parts.

    This “global first, then local, then global again” approach both controls the complexity of each single generation task and makes it easier to localize problems to a specific stage.

    4. System Architecture: Letting LLMs and CAD “Do Their Own Jobs”

    4.1 Layered Design

    A deployable intelligent CAD system can usually be divided into six layers:

    1. Input layer: multimodal entry points for text, drawings, point clouds, and model files, with unified parsing and normalization of units and coordinate systems;
    2. Semantic layer: intent understanding, requirement clarification, and retrieval augmentation against a historical design knowledge base;
    3. Planning layer: decomposing intent into a script plan and deciding which templates and feature operations to invoke;
    4. Generation layer: the LLM produces modeling scripts and parameters, with constrained decoding to guarantee valid output formats;
    5. Execution layer: sandbox execution, geometry-kernel validation, rendering, and asynchronous task scheduling;
    6. Governance layer: version management, access control, audit logging, quality monitoring, and human review.

    The model occupies only layers 2 through 4; what truly determines “whether it can be manufactured” is still the geometry kernel in layer 5. This division of labor both leverages the model’s semantic strengths and preserves the industrial software’s baseline in precision and determinism.

    4.2 Working with Cloud Platform Capabilities

    Smart-manufacturing applications often have the characteristics of “compute-heavy, strongly collaborative, and long-cycle.” General-purpose cloud product capabilities can be used to build a supporting system:

    • Elastic compute: script execution, rendering, and simulation tasks fluctuate widely, and the elastic scaling of container platforms can significantly improve resource utilization;
    • Asynchronous decoupling: task queues take long-running jobs out of the interactive path, avoiding a “stuck” user experience;
    • Data foundation: object storage carries design assets, template libraries, and model files, meeting the storage needs of large volumes and multiple versions;
    • Observability: logging services and monitoring alerts cover key metrics such as script execution failure rate, task queue time, and model-call latency;
    • Knowledge and retrieval: vectorized retrieval capabilities can support intelligent lookup across “historical drawings—similar parts—design experience”;
    • Model services: large-model services from cloud platforms such as Baidu AI Cloud can serve as a general foundation for semantic understanding and script generation, lowering the barrier for enterprises to build their own training and inference clusters.

    4.3 “2D + 3D + Cloud”: The Value of Integration

    2D drawings and 3D models have long coexisted: 2D is convenient for producing drawings and annotations, while 3D is convenient for assembly and simulation. The significance of integration lies in:

    • Single source of truth: modifying one place updates views, annotations, and the bill of materials accordingly, reducing “drawing-model mismatch”;
    • Bidirectional linkage: annotations in 2D can drive 3D parameters, and changes in 3D can flow back into 2D drawings;
    • Cloud collaboration: multiple people can design in parallel, with traceable versions and controllable permissions, giving the model the critical context of the “current design state”;
    • Cross-device delivery: design results can be accessed on demand by roles in manufacturing, procurement, and after-sales.

    Cloud-based deployment also carries a hidden value: when the design process runs as a service, data such as script execution success rate, average time, and adoption rate can be systematically collected, becoming the basis for continuously optimizing models and templates.

    5. Deployment Path: Scenario Priority and Engineering Essentials

    5.1 Judging Scenario Priority

    Not all design tasks are suitable for LLMs. Four dimensions can be used to screen them:

    Dimension Evaluation points
    Structure level Whether there are clear templates, parameter systems, and naming conventions
    Repetitiveness Whether it is high-frequency, batch-processable work
    Risk level Whether errors are easy to detect and the cost is controllable
    Data availability Whether there are enough historical scripts and model samples for training and validation

    Accordingly, scenarios more suitable for early deployment include:

    • Standard-part library construction: batch-generating standard parts such as bolts, flanges, and profiles based on specifications and parameter tables;
    • Drawing to model: automatically turning 2D annotations into editable 3D features;
    • Variant design: generating different specifications and configurations on the same template as a product series;
    • Local modification: for example, “change the hole spacing of a bracket to 120 mm,” modifying only a single component and synchronizing related updates;
    • Layout and asset preparation: equipment placement, material replacement, and render output in scenes such as data centers, production lines, and showrooms;
    • Manuals and bills of materials: automatically deriving a component list and descriptive text from the model structure.

    Higher-risk scenarios such as freeform surface design, precision transmission parts, and safety-critical structures should retain a dual-track mechanism of “model generation + expert approval.”

    5.2 Engineering Essentials

    • Template governance: templates are core assets and require version management, change review, and compatibility strategies to prevent template upgrades from breaking historical scripts;
    • Regression test set: solidify typical scripts, parameter combinations, and expected geometric metrics into a test set, and run automatic regression after each model or template update;
    • Sandbox and least privilege: the script execution environment should limit file, network, and system-call permissions to prevent accidental or malicious operations;
    • Explainability and traceability: record the source of each operation (model-generated / manually modified / template-inherited) to facilitate review and accountability;
    • Human-machine collaboration: the model “drafts” and the engineer “finalizes.” Confirmation steps should be set for critical parameters to avoid “apparently done, actually wrong.”

    5.3 Common Pitfalls

    • The “end-to-end only” fallacy: believing the model should directly output final geometry, ignoring the value of kernel validation and rule constraints;
    • The “parameters only” fallacy: treating the model as a parameter filler, ignoring its ability to understand design intent;
    • Ignoring the cold start: without accumulated historical scripts and templates, generation quality is hard to guarantee, so rules and templates should serve as a fallback first, with models introduced gradually;
    • Underestimating data governance: non-standard drawings, chaotic naming, and missing versions make any intelligent capability far less effective.

    6. Value Assessment: How to Measure the Impact of “AI-Empowered CAD”

    Discussing the value of AI for design software is often reduced to “how much efficiency was gained.” A more rigorous approach is to build a quantifiable evaluation system:

    1. Efficiency dimension: average time per modeling task, script first-pass success rate, and average number of iterations;
    2. Adoption dimension: the adoption rate of AI suggestions, and the proportion of generated scripts used directly or after minor modification;
    3. Quality dimension: geometric validation pass rate, rework rate, and the number of downstream problems caused by design changes;
    4. Scale dimension: the proportion of active users who invoke intelligent capabilities, the number of template reuses, and the share of model-driven tasks;
    5. Economic dimension: per-capita design output, labor cost per design, and the market-response advantage from shortened delivery cycles.

    Among these, the “adoption rate” is the core indicator for judging whether the technology truly creates value. A feature that can generate beautiful scripts but that no one wants to use is merely a demonstration; conversely, a continuously rising adoption rate shows that the model output has become embedded in real workflows.

    From a business perspective, the realization of design software value follows a loop of “lower the barrier → increase usage → accumulate data assets → feed back into capabilities”: a lower usage barrier drives up activity and task volume, and the scripts, parameters, and templates from the design process become the fuel for the next round of model optimization. Conversely, if intelligent capabilities cannot raise the adoption rate, no amount of technical investment will translate into business returns.

    7. Toward “Physical AI”: From Geometry to the Semantics of the Physical World

    7.1 Why CAD Is the Entry Point to Physical AI

    “Physical AI” usually refers to intelligent systems that understand and act upon the physical world. CAD is seen as a key entry point for three reasons:

    • Semantic completeness: a CAD model is not only a geometric shape but also implies materials, processes, mating relationships, and design intent, making it a distillation of engineering knowledge;
    • Starting point of the loop: design results flow downstream into simulation, process planning, CNC machining, and operations, serving as the starting point of the physical world’s “digital twin”;
    • Feedback path: measured data produced during manufacturing and use can flow back into design and model training, forming a self-improving loop.

    7.2 Integration with Simulation and Digital Twins

    Future intelligent design capabilities will likely manifest as an integrated “design–simulate–refine” loop: the model generates an initial solution, simulation evaluates properties such as strength, thermal dissipation, and fluid behavior, and the model then optimizes geometry and parameters based on the simulation conclusions. The challenges of this path include:

    • High simulation cost: high-fidelity simulation is time- and compute-intensive, requiring surrogate or reduced-order models for assistance;
    • Data scarcity: high-quality “design–performance” paired data requires long-term accumulation;
    • Multi-objective trade-offs: strength, weight, cost, and manufacturability often conflict, requiring clear objective functions and weight settings;
    • Traceability: design decisions must be explainable, which is a hard requirement in fields such as aerospace, automotive, and energy.

    7.3 Challenges and Risks

    • Hallucination and geometric errors: the model may “confidently” generate invalid geometry, so kernel validation must serve as a backstop;
    • Intellectual property and data security: design drawings and models are core assets, requiring clear data-usage boundaries and compliance strategies;
    • Attribution of responsibility: if a model-generated design causes a quality incident, dividing responsibility requires agreements at the institutional and contractual level;
    • Insufficient standardization: model files, scripts, and parameter systems lack unified standards, making cross-system collaboration costly;
    • Changes in talent structure: the engineer’s role shifts from “operator” to “reviewer and rule-maker,” and training and organizational processes need to be adjusted accordingly.

    8. Conclusion: Teaching Models to “Build Objects by the Rules”

    LLMs entering CAD is essentially an interface between “semantic capability” and “deterministic engineering.” The former is good at understanding vague requirements, generating candidate solutions, and communicating across modalities; the latter is good at rigorous solving, guaranteeing precision, and bearing reliability responsibility. A truly valuable intelligent design system does not replace the geometry kernel with a model, but rather makes the model an efficient “translator” and “orchestrator” between the engineer and the kernel.

    The practical advice for enterprises is:

    1. Start from scenarios: first choose tasks that are structured, highly repetitive, and low-risk;
    2. Make validation solid: geometric validation, rules engines, and regression testing are the foundation of intelligent capability;
    3. Make scripts an asset: templates, scripts, and parameter systems must be governed to generate compounding returns;
    4. Use adoption rate as the yardstick: verify value with real usage data rather than staying at the demonstration effect;
    5. Focus on the long-term loop: the flow-back of design, simulation, and manufacturing data is the true moat of “Physical AI.”

    When a model can not only understand a sentence from an engineer but also turn it into a manufacturable design under the constraints of the geometry kernel, CAD is no longer a mere drafting tool but becomes an interface connecting human intent with the physical world.