---
title: "AutoCAD to G-Code: The Workflow and Manual Editing"
description: "AutoCAD never outputs G-code; the route is DXF into a CAM tool, post, then targeted hand edits. Here is the pipeline, drawing hygiene, and what is safe to edit."
url: https://gcodepractice.com/journal/autocad-to-g-code-manual-editing/
canonical: https://gcodepractice.com/journal/autocad-to-g-code-manual-editing/
author: "Lawrence Arya"
authorUrl: https://www.linkedin.com/in/vibecoding/
published: 2026-06-04
updated: 2026-06-04
category: "Practice"
tags: ["autocad", "dxf", "cam", "manual-editing"]
lang: en
---

# AutoCAD to G-Code: The Workflow and Manual Editing

> **TL;DR** AutoCAD produces geometry, not motion, so the working route is exporting DXF, generating toolpaths in a CAM tool, posting G-code for the target machine, and then hand-editing the output where it is safe: feeds, lead positions, ordering, headers. Drawing hygiene upstream, closed polylines, sane layers, explicit units, decides how clean the code comes out, and the units declaration is the classic trap between a drawing and a machine.

[AutoCAD](https://en.wikipedia.org/wiki/AutoCAD) draws the part; it does not move the machine, and no export setting changes that. Between a DXF and a running program sit two stages: a [CAM step](https://en.wikipedia.org/wiki/Computer-aided_manufacturing) that adds the machining, and, more often than anyone admits, a hand-editing step that adapts the posted code to reality. Knowing what belongs in each stage is the whole workflow.

## What does the pipeline look like?

| Stage | What happens | What can go wrong |
| --- | --- | --- |
| Draw | Geometry in AutoCAD | Open contours, stray segments, unit ambiguity |
| Export | DXF out | Wrong version, exploded polylines |
| CAM | Tools, feeds, leads, depths assigned | Garbage in, garbage toolpaths |
| Post | G-code for the target machine | Post quirks, wrong dialect details |
| Hand edit | Targeted fixes at the machine | Editing the wrong things |

The pipeline's quality flows downhill: every shortcut in the drawing stage resurfaces as a code problem four stages later, which is why the unglamorous cleanup work pays best.

## What drawing hygiene produces clean code?

Five habits, all cheap in the drawing and expensive to skip. **Join contours** into closed polylines, so CAM sees one shape rather than a confetti of segments and posts one continuous cut. **Purge** duplicates and stray geometry, the invisible double line that becomes a double cut. **Layer by intent**, outside cuts, holes, engraving each on their own layer, so CAM assigns operations wholesale. **Draw at final scale**, never to-be-scaled-later. And **declare units consciously**: DXF carries unit ambiguity badly, and a metric drawing interpreted as inches downstream produces the 25.4x error this site keeps meeting, the same failure family as [a machine moving in inches instead of mm](/journal/why-is-my-cnc-moving-in-inches-instead-of-mm/).

## Why does hand editing exist at all?

Because posts are generic and machines are specific. The posted file arrives with a header your control half-likes, feeds the CAM guessed conservatively, lead-ins placed by algorithm rather than judgment, and occasionally a [dialect](https://linuxcnc.org/docs/html/gcode/g-code.html) detail wrong for your machine. The realistic options are maintaining a custom post, the deeper fix described for [SheetCam post processors](/journal/sheetcam-post-processor-g-code-edit/), or making targeted edits per job, and small shops do the latter daily, one slice of the permanent manual layer cataloged in [why machinists still write G-code](/journal/why-do-machinists-still-write-g-code-manually/).

## What is safe to edit, and what is not?

| Safe to hand-edit | Leave to re-posting |
| --- | --- |
| Feeds and speeds (`F`, `S`) | Contour coordinates |
| Lead-in/start positions | Arc centers and geometry |
| Cut ordering (block moves) | Anything traced from the drawing |
| Header and footer blocks | Wholesale operation changes |
| Machine-specific M-codes | Kerf or comp side decisions |

The rule underneath the table: edit **values and arrangement**, never **geometry**. A feed change is reversible and visible; a nudged coordinate silently divorces the program from the drawing it came from, and the next person to re-post from the DXF reintroduces whatever the nudge was hiding. Geometry problems go back to AutoCAD, get fixed once, and flow forward clean.

A concrete example of the split: a bracket's posted file needed slower feeds in the tight inside corners, a start point moved off the visible edge, and the shop's preferred header. All three were five-minute hand edits. The same file's slightly undersized slot, though, went back to the drawing, because the slot was wrong in the DXF, and fixing it in code would have made the drawing a liar forever after.

## Bottom line

AutoCAD to G-code runs drawing, DXF, CAM, post, then targeted hand edits: clean closed geometry and explicit units upstream, machining judgment in CAM, and at the machine edit only values and arrangement, never geometry. Fluent reading is what makes the editing safe, and the reading layer drills free on the [G-code practice hub](/g-code-practice/).

## Sources

- [Wikipedia: AutoCAD](https://en.wikipedia.org/wiki/AutoCAD)
- [Wikipedia: Computer-aided manufacturing](https://en.wikipedia.org/wiki/Computer-aided_manufacturing)
- [LinuxCNC G-code reference](https://linuxcnc.org/docs/html/gcode/g-code.html)

## Frequently asked questions

### How do you get G-code from AutoCAD?
Through CAM: export DXF, assign tools, feeds, leads, and depths in a CAM tool, and post for your machine. AutoCAD describes geometry, not motion, so the CAM stage is not optional.

### What should you fix in the drawing before exporting DXF?
Join contours into closed polylines, purge strays and duplicates, layer cuts by intent, draw at final scale, and declare units consciously to avoid the 25.4x trap.

### What is safe to hand-edit in posted G-code?
Values and arrangement: feeds, lead positions, ordering, headers, machine-specific lines. Geometry edits belong upstream in the drawing, then re-post.

### What is the best way to learn to edit posted G-code confidently?
Read fluently first. A free app like G-Code Sprint drills the everyday codes and repeats whichever ones you miss; confident value edits follow once every block narrates itself.

*G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.*

---

Source: https://gcodepractice.com/journal/autocad-to-g-code-manual-editing/
Author: Lawrence Arya — https://www.linkedin.com/in/vibecoding/
