ToolChange Modifier¶
Insert your own G-code around every tool change in a program, without editing the file by hand or changing your post processor.
The tool runs entirely in your browser — the file is read locally and never uploaded anywhere.
The usual reason to use it
AutoDustBoot. If you retract and expand the boot with M9/M8, the boot
has to be out of the way before the spindle goes to the tool change
position, and back down after the machine has moved to the first cut.
Dropping M9 before the change and M8 after the first rapid puts those
commands exactly where a collision is least likely.
M9, G4 P0.5. Inserted immediately before any line containing M6 or M98.G0 that carries both an X and a Y following the tool change — the move to the first cut.What it changes¶
The tool walks the program line by line and makes two kinds of insertion:
| Where | Rule |
|---|---|
| Before tool change | Immediately above any line containing M6 or M98. |
| After tool change | After the first G0/G00 following that tool change that carries both an X and a Y — the rapid to the first cut. |
Everything else is copied through untouched, and the result is written to a new
file with _modified added to the name — your original is never overwritten. A
; Modified by ToolChange Modifier comment is added as the first line so you
can tell a processed file apart at a glance.
Remove these commands where the file already has them deletes existing
copies of the commands you entered, so a program that already contains stray
M8/M9 lines ends up with them only where this tool puts them. M08 and
M8 count as the same command.
Typical AutoDustBoot setup¶
| Field | Value |
|---|---|
| Before tool change | M9 |
| After tool change | M8, G4 P1 |
M9 lifts the boot out of the way before the spindle travels to the tool
change position; M8 lowers it once the machine is over the first cut, and
G4 P1 gives it a second to settle before the spindle plunges.
See AutoDustBoot → for wiring and for the macro side of the setup.
Notes¶
- Matching is textual: a line containing
M6anywhere — includingT2 M6— counts as a tool change. - If a tool change is never followed by a
G0with both X and Y, the "after" commands are skipped for that change rather than guessed at. - Chrome and Edge ask where to save the file. Other browsers drop it in your downloads folder.