VIDEO REVIEW · REALITY CHECK

Can You Generate G-code with ChatGPT? One Honest Experiment Video Gives the Best Answer

Can you generate G-code with ChatGPT? One honest experiment video gives the best answer—article cover image
TL;DR The DIY channel Random Routing ran an experiment: hand a drawing to ChatGPT and, in the end, produce runnable G-code. But the architecture is the point—the author doesn't let AI write the G-code; he has it only "read the drawing to find features and dimensions" and output structured intermediate data (a seed), which a script then draws into a DXF and, by layer rules, hands to CAM software to generate code from templates. In the author's own words: "We don't rely on AI to generate the machine's G-code directly—that would be dangerous." This DIY experiment happens to demonstrate the correct architecture of professional AI CAM: AI does the understanding, deterministic rules and verification do the output. The difference between a general-purpose chatbot and a purpose-built AI CAM isn't whether it can write G- and M-codes, but whether it has the whole safety mechanism of a tool library, machine limits, simulation and verification.

01What this video is about

In March 2025, the DIY machining channel Random Routing uploaded this proof-of-concept video: "Drawing to gcode using ChatGPT." The title sounds like standard "AI does everything" content, but open it up and it's a rare, honest engineering experiment[1].

Random Routing's proof of concept: ChatGPT reads the drawing, while a script and CAM templates generate the code (open on YouTube)

There's actually plenty of similar content—for example, tutorials on using ChatGPT to generate plasma-cutting designs (generate an image first, convert to SVG, then clean it up in CAD)[2]—but what makes Random Routing's video special is that the author wrote out the full system architecture, and why it was designed that way, in the description.

02The clever part of the experiment: AI does only "understanding," not "output"

Per the author's description, the whole flow goes like this[1]:

  1. ChatGPT reads the drawing and is responsible only for finding the features and dimensions, outputting a structured "seed" containing the part information;
  2. A script parses the seed and deterministically draws a DXF file, placing different features on their corresponding layers (outer contour, inner contour, standard holes, small holes, counterbores, tapped holes…);
  3. The CAM software recognizes these layers and generates G-code from pre-validated templates.

Then comes the most valuable line of the whole video, the author's own words: "This means we don't rely on AI to generate the machine's G-code—that would be dangerous."[1] A DIY channel, in a single sentence, states the engineering judgment that so many AI product decks are unwilling to say.

03Why you can't let a chatbot write G-code directly

A general-purpose language model can of course "write" G-code—G- and M-codes are an open standard (ISO 6983 defines the program format and address words)[3], and there are plenty of examples online to learn from. The problem shows up on three levels:

In theory, deep learning's successful applications in manufacturing (research reaching about 96.7% accuracy in feature recognition is one example) all share a common structure: the model handles perception and understanding, and its output enters a deterministic engineering pipeline to be constrained and verified[4][5]—exactly the intuition of this DIY experiment.

04What a purpose-built AI CAM pipeline looks like

Engineer and scale up Random Routing's hand-built architecture, and you get what professional AI CAM looks like. Take BestAI CAM as an example—the correspondence is direct:

What the DIY experiment didThe purpose-built pipeline's counterpart
ChatGPT reads the drawing and produces a seedAI recognizes the 2D drawing (DWG/PDF/photo assist) and builds a 3D model
A script deterministically draws the DXF and layers itInfers operations and toolpaths from the shop's tool library, controller and travel/spindle-speed ceilings
CAM generates code from validated templatesAfter G-code generation, enforces 3D cutting simulation to check gouging, interference and collisions
The author eyeballs the result himselfAn independent AI cross-compares dimensions against the original drawing + a professional gate-keeps before the machine runs

The difference isn't "whose AI is smarter," but the completeness of the safety mechanism: the purpose-built pipeline turns every safeguard the DIY experiment maintained through the author's personal caution into a mandatory, built-in step. That's also why we keep saying: when evaluating an AI CNC tool, don't ask whether it can generate G-code—ask how many verification steps stand before the machine runs after it's generated (for the full flow, see The Complete Guide to CNC Automated Programming; for what generative AI can and can't do, see Generative AI Enters the Factory).

05FAQ

Can ChatGPT actually write usable G-code?

For simple geometry in loose scenarios (like drawing lines on an engraver), it can write a syntactically runnable program. But syntactically correct isn't the same as physically safe: it doesn't know your controller dialect, tools, travel limits or workholding, and the cost of one wrong line is a crash and a scrapped part. That's exactly why the video's author lets AI only read the drawing and hands code generation to deterministic scripts and templates.

What's the difference between this DIY video and commercial AI CAM?

The architectural intuition is the same (AI does the understanding, rules do the output); the difference is engineering completeness: a commercial pipeline brings the tool library and machine limits into the inference, enforces cutting simulation, and adds independent dimensional cross-verification and human gate-keeping—turning the safeguards the DIY relies on personal caution to maintain into mandatory system steps, and it can handle higher-stakes scenarios like milling.

When evaluating an AI code-generation tool, what's the single most important question to ask?

"After the G-code is generated and before it runs on the machine, how many verification steps are there?" A good answer includes at least: generation according to the shop's tool library and machine limits (not generic assumptions), enforced 3D cutting simulation, independent dimensional cross-comparison, and a final human confirmation before the machine runs. Code-generation speed without a verification chain moves the risk downstream rather than eliminating it.

Subscribe to the tech-blog newsletter

We'll let you know when new articles and video walkthroughs go live—no inbox flooding, one-click unsubscribe. (newsletter in Chinese)

AI WITH GUARDRAILS

Get AI's speed, plus an engineering-grade safety chain

Read the drawing and model it, generate code within the shop's limits, enforce simulation, verify dimensions independently, gate-keep by a human—run your own drawing through an AI code-generation flow with guardrails.

Contact an onboarding consultant Training courses

📋 Free download: "CNC Outsourcing Checklist" (printable) (中文)

← Back to the BestAI CAM product overview

06References

  1. Random Routing (YouTube). Drawing to gcode using ChatGPT (published 2025-03-09). youtube.com/watch?v=vOyaLsN6V7A
  2. Slyh Life (YouTube). How to Use ChatGPT to Create CNC Plasma Designs. youtube.com/watch?v=YCC2JAts80g
  3. ISO 6983-1:2009. Automation systems and integration — Numerical control of machines — Program format and definitions of address words. ISO.
  4. Zhang, Z., Jaiswal, P., & Rai, R. (2018). FeatureNet: Machining feature recognition based on 3D Convolutional Neural Network. Computer-Aided Design, 101, 12–22.
  5. Wang, J., Ma, Y., Zhang, L., Gao, R. X., & Wu, D. (2018). Deep learning for smart manufacturing: Methods and applications. Journal of Manufacturing Systems, 48, 144–156.