Getting started with Custom G-code
This tutorial walks you through the Custom G-code Editor from first launch to editing a real G-code file. Follow along step by step — no prior G-code editing experience required.
Step 1: Choose Custom G-code
From the empty canvas (or after removing a current module), you'll see the module picker. Click Custom G-code to create a new G-code editing module.
The editor opens with an empty canvas — a toolbar at the top, an outline panel on the left, and the Monaco code editor in the center.
Step 2: Import a G-code file
Click the Import button in the toolbar to open a file dialog. Select any .gcode file from your slicer (Cura, PrusaSlicer, OrcaSlicer, Simplify3D — all supported).
The file loads into the editor, and several things happen automatically:
- The G-code text appears in the editor with syntax highlighting
- The structural outline populates with layers and regions
- The metrics panel shows print time, filament usage, and more
- The 3D viewer displays the toolpath
Step 3: Explore the interface
Take a moment to orient yourself:
- Toolbar (top) — shows the file's line count, detected dialect (Marlin, Klipper, etc.), import button, read-only toggle, color mode selector, travels/Z-hops, and the startup/end checkbox
- Outline (left) — tree of sections: Startup, optional Objects, Layer 0, Layer 1, ..., Shutdown. Each layer expands to show regions like Perimeter, Infill, Support
- Editor (center) — the G-code text with colored syntax. Scroll, search, or click anywhere. The same
displaySourcefeeds the dock tools - Dock tools — Metrics (stats + charts), Snapshots (version history + diff), Tools, Diagnostics, Resume from Z
Step 4: Navigate with the outline
Click any section in the outline panel. Three things happen simultaneously:
- The editor scrolls to that section's starting line
- The lines in that section are highlighted in the editor
- The corresponding toolpath is highlighted in the 3D viewer
Try clicking different layers to jump around the file. Expand a layer to see its sub-regions (Perimeter, Infill, Support) and click those to zoom in to specific parts of the print.
Step 5: Read the metrics
Switch to the Metrics tab in the dock to see the global file statistics:
Print Time: 2h 15m 32s
Filament Length: 12.45 m
Filament Volume: 8.32 cm3
Layers: 142
Avg Flow: 4.2 mm3/s
Peak Flow: 12.8 mm3/s
Retractions: 1,240
Now select a range of lines in the editor (click and drag, or click a section in the outline). The metrics panel switches to show selection-scoped statistics for just that range. This is a fast way to answer "how long does this layer take?" or "what's the flow rate in this section?"
Step 6: Change the color mode
In the toolbar, find the Color dropdown (defaults to "Speed"). Try switching to different modes:
- Speed — see where the printer moves fast (red) vs slow (blue)
- Temperature — see where temperature changes happen
- Line Type — see perimeters (orange) vs infill (green) vs support (blue)
- Layer Index — rainbow gradient showing layer-by-layer progression
Each mode reveals different aspects of the print. Speed mode is particularly useful for finding sections where the slicer set unusually high or low feedrates.
Step 7: Modify speed on a selection
Let's make a targeted edit. Suppose layer 3 has a tricky overhang and you want to slow it down:
- Click Layer 3 in the outline panel
- In the Precision Tools section, find Speed
- Type
0.7in the multiplier field (70% of current speed) - Click Apply
All F (feedrate) parameters in that layer are now multiplied by 0.7. Check the metrics panel to see how the estimated time changed.
If you don't like the result, press Ctrl+Z to undo.
Step 8: Create a snapshot
Before making bigger changes, save your current state:
- Switch to the Snapshots tab in the dock
- Type a name: "After speed tweak on layer 3"
- Click Save
The snapshot appears in the list with a timestamp and line count. You can restore this exact version at any time by clicking Restore, or open Diff to compare the snapshot with the current editor in a side-by-side Monaco diff.
Step 9: Use the debugger
The debugger lets you step through the G-code like a programmer steps through code:
- Open the Debugger panel
- Click Step Forward to advance one command at a time
- Watch the machine state update: position, temperature, fan speed, extrusion
- The 3D viewer shows a yellow nozzle indicator at the current position
Try these workflows:
- Find the first extrusion: step forward until you see
Total Extrudedincrease from 0 - Check retraction behavior: use the Retract jump button to hop between retraction events
- Inspect a specific line: click a line number in the editor, then check the state inspector
Setting breakpoints
If you want the debugger to pause at specific lines during playback:
- Navigate to the line of interest
- Click Add BP in the debugger panel
- The line number appears as a red badge
- During playback, execution pauses automatically at that line
Step 10: Export the edited G-code
When your edits are complete:
- Use the standard 3dSynth export flow (Export button in the top bar)
- The modified G-code is saved as a
.gcodefile - Load it into your printer's SD card or send it via OctoPrint, Mainsail, or your preferred interface
Next steps
- Editor features — dig deeper into syntax highlighting, autocomplete, and themes
- Analysis and visualization — learn about all 8 color modes and the metrics system
- Tools and debugging — explore batch operations, safe reordering, and advanced debugging
- Warnings reference — understand every warning code the editor can detect
- G-code command reference — comprehensive reference for all G/M codes