G-code to Lines (Toolpath › G-code to Lines) turns a G-code object into a lines object: one polyline per move of the program. Use it when you need the toolpath as ordinary geometry, for example to measure its length, offset it or build a mesh or a tube from it.
Convert a Program to Lines
- Open a G-code program (.gcode, .nc or .txt) with Open Files, or build one with Toolpath.
- Select exactly one G-code object and click Toolpath › G-code to Lines.
- Choose whether to keep the idle moves: turn on Save Idle Movement to include them. Idle moves are the rapid G00 moves, when the tool travels without cutting. The option is off by default, so the result holds only the cutting moves.
- Click Convert.

The tool replaces the G-code object with a lines object of the same name; objects that were under the G-code object move under the new lines object. A closed move (one that ends where it starts) becomes a closed polyline. To get the G-code object back, use Undo.

What You Can Do With the Lines
The result works with every tool of the Lines tab. Select it, and the Information panel shows the total Length of the path and its number of Components; to inspect single vertices and edges, use Lines Info. To turn the path into a mesh, a tube or an extrusion, see Lines & Distance Maps Basics.
Once converted, the path is no longer a program: the G-code Visualizer and the milling simulation need the G-code object. Run them before you convert, or open the file again.