Skip to content

G-code generator from blocks: printer check and 3D simulation

Build a 3D printer process from blocks while the tool writes the G-code line by line. The check runs it against your printer and material, and the simulation shows the nozzle path in 3D.

Part of Pro, 15 EUR a month.

G-code Lego: building G-code from blocks

G-code Lego is an online G-code generator from EduFacturing, part of Pro, that builds G-code for a 3D printer from blocks. The order of the blocks is the order of the commands. An atom is one command (M104), a brick is a short sequence (heat up, park), and a plate is a whole procedure (a temperature tower, PID tuning).

After every block the tool remembers the machine state: whether it is homed, whether coordinates are absolute or relative, and what the temperatures are. A block that needs a different state is flagged as an error.

It does not replace the slicer; it shows the command behind each action. The output is Marlin-style G-code.

G-code generator: a stack of four blocks (start sequence, temperature tower, heat up, end sequence) for a Creality Ender-3 and PLA
G-code generator: a stack of four blocks (start sequence, temperature tower, heat up, end sequence) for a Creality Ender-3 and PLA

G-code for a 3D printer, a temperature tower and PID: what it does

Builds G-code from 55 blocks

Eight categories: motion, temperature, extrusion, automation, calibration, fun, experimental and service. There is a search and nine ready-made recipes.

Tracks the state and checks the G-code

Errors: a move before G28, extrusion with a cold nozzle, a temperature above the maximum for the material or the printer, a target outside the build volume, and a block the printer does not support. The download stops on an error or an empty process; warnings and notes do not stop it.

Shows the code and simulates in 3D

Each block line points to its block; clicking selects it. The simulation draws the nozzle path in 3D, at up to 4× speed, with an estimate of time and filament.

Imports finished G-code, saves and sends

Finished G-code is taken apart into blocks. A process is saved in the browser or in your profile and shared by link. It downloads as .gcode, or is sent to a printer in PrintERP after confirmation.

When you need a G-code generator

G-code makes sense when you can see where every line comes from.

  • Students: how to write G-code

    They build a start sequence block by block and see the command behind each one. The errors teach the order: homing before motion, a nozzle waited to temperature before extrusion.

  • A temperature tower for a new filament

    A temperature tower, retraction, first-layer and flow tests, PID tuning. The tower starts at 220 °C and is checked against the material’s maximum.

  • Batch printing and pauses

    One block prints N copies with cooling and push-off between them. A pause-to-embed block stops the printer for a nut or a magnet.

  • Checking someone else’s G-code

    A start block from a forum is imported and checked for your printer and material before it reaches the machine.

How blocks become G-code and how it is checked

Blocks reduce to leaves: atoms and 8 plates that write their own lines. The check walks through them in order.

  1. Expand

    Bricks and 6 of the plates are expanded into atoms. The other 8 plates (the tower, the tests, the shape) write their own lines.

  2. State

    After every atom or leaf plate the homing, G90 or G91, M82 or M83 and the temperatures are updated.

  3. Rules

    Temperatures are checked against the highest value for the material (the rules core) and against the printer limit, and targets against the build volume.

  4. Code and simulation

    The generator writes the commands, and the simulator runs the finished text and counts time, moves and filament.

The formulas and rules in the tool
Applies toFormulaMeaning
Extrusion (E)E = L·w·h / (π·(d/2)²)mm of filament for a line of length L, width w and layer h; d is 1.75 mm. For 10 mm at 0.4 × 0.2 mm: 0.333 mm
Temperature towerT_k = T₀ + k·ΔTdefaults: 220 °C, a step of −5 °C, 5 segments; the last cannot go below 170 °C

A G-code generator with a check and a simulation: what is different

  • The state is checked

    Errors sit next to the block that causes them. For homing, coordinate mode and a hot nozzle a Fix button inserts the missing block.

  • Profiles know what they cannot do

    Bambu Lab does not get M600, M0, M300 and PID, and G29 is only for the Prusa i3 MK3S+. Such a block is placed but gets an error, and the download stops.

What it does not do: slicing, printing, your own printer

The tool checks the logic of the commands, not the print: it does not tell you whether the layer will stick or the material will pass through the nozzle. Time and filament are estimates, and heating uses a rough rate from the profile.

The output is Marlin-style only. There are seven profiles, and you cannot set your own printer with manual dimensions. The LED blocks (M150) give an error in all seven.

Questions about G-code, a temperature tower and blocks

What is G-code?

A list of commands to the printer, one per line, like M104 S210. This tool writes them for you from blocks and shows the command behind each block.

How to write G-code?

Each command is one line, like M104 S210. Here you pick an atom, a brick or a plate and the lines are written for you; for a hand-written line there is the Raw G-code line block.

How to make G-code for a 3D printer?

Build the process from blocks: their order is the order of the commands, and the tool writes the G-code line by line. Then check it against your printer and material and download it as .gcode.

How to make a temperature tower?

Add the Temperature tower plate. By default it starts at 220 °C with a step of −5 °C and 5 segments, and the last one does not go below 170 °C. Temperatures are checked against the maximum for the material.

Which printers are available?

Seven: Creality Ender-3, Ender-3 V2 and CR-10, Prusa i3 MK3S+, Bambu Lab P1P, X1 Carbon and A1 mini. For Bambu Lab the file downloads as .gcode.3mf.

How much does G-code Lego cost?

15 EUR a month, as part of Pro. Pro also opens the other Pro tools in the catalog.

The G-code generators from blocks is part of Pro

Pro costs 15 EUR a month and opens all 45 Pro tools.

Build your first G-code

Part of Pro, 15 EUR a month.