# Interactive Wizards
This section details the G-codes and features associated with the Interactive Wizard system. The Wizard feature allows for dynamic, interactive sequences during a print job, enabling the display of progression windows, user prompts, and conditional macro execution based on user input. They are typically used in conjunction with G-code Templating.
Job or Macro Context Only: Wizard G-codes are available only when called from inside an active Job or macro/calibration. Executing these commands manually from the console will result in an error and will not trigger the UI.
Job Cancellation: If a user clicks the Cancel button on any Wizard prompt or progression window, the mainboard will immediately cancel the current active job or macro.
# Add Wizard Field G-codes
Those G-codes add input fields to a wizard popup being constructed. Fields will be displayed in the same order as they are added.
# Display Wizard G-codes
These commands render the wizard popup using the fields previously defined with the field G-codes used since the last Wizard displayed.
# Reference
# Typical Usage Pattern
A complete wizard interaction follows this sequence:
- Add one or more fields using W1–W5, W40, or W50.
- Display the popup with W100 (fire-and-forget) or W101 (wait for user input).
- Use the response from the user in the template. See WizardResponse Variable for detail of what is available.
; Define a float field for nozzle temperature
W1 M"Nozzle Temp" F"nozzleTemp" D200 L150 U280 S"°C" R
; Define a choice field for material
W4 M"Material" F"material" R
W40 M"Material" F"material" V"PLA"
W40 M"Material" F"material" V"PETG"
W40 M"Material" F"material" V"ABS"
; Display the popup and wait for the user to confirm
W101 T"Print Setup" M"Configure your print before starting." O
M104 T0 S{{ default(WizardResponse.field.nozzleTemp, 200) }}
{% if default(WizardResponse.buttonClicked, "ok") == "ok" %}
{% if default(WizardResponse.field.material, "PLA") == "PLA" %}
M140 S75
{% else %}
M140 S110
{% endif %}
{% endif %}