adielfernandez
Posts: 2
Joined: Mon Dec 15, 2025 4:23 pm

Extra Prime Pillar repetitions in gcode after extruder change

I have a print job that requires a tool change from extruder #1 to #2 after a certain layer using a prime pillar. I utilize two different processes set to each layer zone. After the tool change (beginning of process 2), the prime pillar code shows up many times within that first, post-tool-change layer. In fact, there are calls to the prime pillar gcode in between individual perimiter/infill gcode features. This results in enough over extrusion that the plastic build up interferes with the extruder and can knock down the pillar itself.

Job Setup:
Process 1 sets the zone on the model from Z=0 to z=9.2mm. Uses prime pillar.
Process 2 is set to zone above z=9.2mm, uses prime pillar but sets "auto stop prime pillar after 0 additional layers"

If you look at the attached g-code and ctrl+F search for the "feature prime pillar" comments, there are 45 prime pillar gcode instances for Process 1, one for each layer (layer 0 to layer 45). Meanwhile there are about 22 instances of the prime pillar g-code on layer 46 alone and the following few layers. Despite setting the prime pillar to stop on the first layer.

So there are about 95 extra calls to the prime pillar when there should be only 1!

I can't seem to figure out how to make it go away with any settings, anyone seen this before?

All settings and models attached below for bug repeatability. Link to g-code file since it was too big to attach: https://drive.google.com/file/d/1zp5Vfa ... sp=sharing
Attachments
TilePrintJob.factory
(684.98 KiB) Downloaded 1838 times
Three Circles Tile.stl
(1.7 MiB) Downloaded 1879 times
adielfernandez
Posts: 2
Joined: Mon Dec 15, 2025 4:23 pm

Re: Extra Prime Pillar repetitions in gcode after extruder change

I used Claude to make a utility script that removes all the extra prime pillar calls from a gcode file.

To use:
  • Make sure you have python 3.9 or later installed
  • Save the text in a file called "RemoveDuplicatePrimePillars.py" in the same directory as your gcode file
  • Open a Command Prompt or Terminal window in the that directory
  • Call the script with with python and the desired file to fix:

    Code: Select all

    python RemoveDuplicatePrimePillars.py myBadGcodeFile.gcode
Optional Parameters:
Add --dry-run to get a summary of changes without making the change
Add --output myCleanedFile.gcode to the end to leave the original file as is and save the changes to a new one. If no output is specified it'll change the original file


Examples:

Code: Select all

python RemoveDuplicatePrimePillars.py myFile.gcode
python RemoveDuplicatePrimePillars.py myFile.gcode --output myNewFile.gcode
python RemoveDuplicatePrimePillars.py myFile.gcode --output myNewFile.gcode --dry-run
Haven't tested anywhere other than my Windows 11 PC, so back up your files before using.

Return to “Troubleshooting and Bug Reports”