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 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?

StageWhat happensWhat can go wrong
DrawGeometry in AutoCADOpen contours, stray segments, unit ambiguity
ExportDXF outWrong version, exploded polylines
CAMTools, feeds, leads, depths assignedGarbage in, garbage toolpaths
PostG-code for the target machinePost quirks, wrong dialect details
Hand editTargeted fixes at the machineEditing 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.

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 detail wrong for your machine. The realistic options are maintaining a custom post, the deeper fix described for SheetCam post processors, 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.

What is safe to edit, and what is not?

Safe to hand-editLeave to re-posting
Feeds and speeds (F, S)Contour coordinates
Lead-in/start positionsArc centers and geometry
Cut ordering (block moves)Anything traced from the drawing
Header and footer blocksWholesale operation changes
Machine-specific M-codesKerf 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.

Sources

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.