The G-code macros feature: custom G-code at every print action
G-code macros let you decide exactly what G-code runs at key moments - when a print starts, finishes, is cancelled, paused or resumed, and when you move an axis, change speed, home, or run a calibration. In this guide you'll learn what macros and snippets are, where to find them, how the new editor works, and how to assign different G-code to different printers.
Contents
- Where to find G-code macros
- Snippets vs macros
- The macro editor
- Macro types you can set
- Assigning macros to specific printers
- Organization vs personal macros
- Standard SimplyPrint snippets
- Running a macro or snippet on demand
- Variables and conditional logic
Where to find G-code macros
G-code macros now live in your account settings. Open Settings, then select the Gcode Macros tab. You'll find every macro type, your snippet library, and the editor all in one place.

Snippets vs macros
The two building blocks work together:
- A snippet is a saved, named script of G-code you can reuse. For example, a "move to center" snippet that parks the head and bed in the middle of the plate.
- A macro is what actually runs on a trigger (print start, print end, cancel, and so on). A macro can stack several snippets in any order, plus raw G-code lines, and the same snippet can be reused across many macros.
This separation means you write a piece of G-code once as a snippet, then drop it into as many macros as you like instead of copy-pasting it everywhere.
The macro editor
Each macro opens a full code editor with syntax highlighting, hover hints, and autocomplete. Start typing a command and SimplyPrint suggests matches; hover a variable to see what it does.

The toolbar under the editor has three buttons:
- Include snippets - search your snippet library and insert a snippet, or create a new one on the spot. Inserted snippets show up as a labelled block in the editor that you can remove with one click.
- Variables - browse and search every available variable, grouped by type. Click one to insert it at your cursor.
- Help & docs - quick links to the relevant SimplyPrint guides plus the Marlin and Klipper G-code references.
Changes save when you click Save on each macro card. A View button next to Save shows you the final, compiled G-code that will actually be sent, with the variables already filled in for your printers.
Macro types you can set
The available macros are grouped by purpose. You won't necessarily see every group - some only appear for the relevant printers or plans.
- Print actions - what runs when a print is cancelled, paused or resumed. For OctoPrint-powered printers these sync with OctoPrint's own G-code scripts.
- Printer control - move axis, change print speed, change flow rate, home, motors on/off, and fans on/off. These also power the matching buttons in the printer control panel.
- Printer calibration - baby stepping and the Z-offset calibration steps used by the remote Z-Offset calibration tool.
- AutoPrint (advanced) - the bed-clearing and end-of-job G-code that lets AutoPrint run unattended. This group only appears on plans that include AutoPrint.
Assigning macros to specific printers
By default a macro applies to all your printers. You can override that per printer.
- Open the macro you want to change.
- Use the printer selector at the top of the tab to pick a specific printer.
- Edit the G-code for that printer and save.
The printer keeps its own version while every other printer keeps the default. When one or more printers override a macro, SimplyPrint shows a blue notice listing exactly which printers differ from the default, so nothing is overridden by accident.

Organization vs personal macros
If your account has multiple users (a school, makerspace, or print farm), you may see two tabs at the top:
- Organization (or Account) macros apply to everyone in the account.
- Personal macros let you decide what happens when you print, without changing anyone else's setup. Personal macros are only available if your account allows them.
Personal macros automatically inherit the organization's snippets, so you can build on top of the shared setup instead of starting from scratch. A few macro types (such as the AutoPrint group) are organization-only and won't appear on the personal tab.
Standard SimplyPrint snippets
New accounts start with a built-in "Standard snippet" already wired into the relevant macros. We maintain these defaults so they work across a wide range of printers, and for some printer models we assign a model-specific version automatically. If a default works for you, there's nothing to change. When you do want custom behaviour, edit the macro or swap in your own snippet.
Running a macro or snippet on demand
You don't have to wait for a trigger. On the Printers panel, click the Execute G-code icon (the terminal icon, >_) in the top-right corner. Pick one or more printers, then send raw G-code or choose a saved snippet or macro to run right away.

Variables and conditional logic
Variables are placeholders that get filled in per printer when the G-code is sent. For example, M104 S{max_extruder_temp} heats each printer to its own configured maximum, so one snippet works across printers of different sizes.
You can also use simple math, like {{bed_x} / 2} to find the center of any bed, and conditional logic such as {#if firmware_is_klipper} to send different commands to different firmware. The full reference - every variable, the math rules, and the conditional syntax - is in the snippets guide below.
Related articles
- G-code snippets, variables, and assigning macros - the deep-dive on snippets, the full variable reference, and conditional logic
- SimplyPrint Slicer variables - placeholders available when slicing
- Z-Offset calibration: fine-tune your first layer remotely
- What is G-code for 3D printing, and how to read and write it
Updated on: 25/06/2026
Thank you!