Finding objects in G-code with sequential printing enabled
 
Notifications
Clear all

Finding objects in G-code with sequential printing enabled  

  RSS
UjinDesign
(@ujindesign)
Estimable Member
Finding objects in G-code with sequential printing enabled

Hi. This is kind of the first time I'm looking into the G-code directly and editing it. 

I'm doing some calibration tests on my Mini and I am editing G-code to have the machine do different things for different objects. One slightly tedious and somewhat human-error-prone thing is finding where in the G-code the printer is starting to print a new object (I currently do it by finding when the printer returns to a z-height of 0.2 mm). 

When asking generative AI, it insists that the generated G-code from Prusa Slicer leaves comments "; printing object <name> ..." when the printer is starting to print a new object, but I cannot find such comments in my generated G-code. 

Am I doing something wrong? Is there another way of finding when the printer starts printing a new object by looking at the G-code? Please feel free to look at my attached project file that I'm using to generate the G-code.

Thank you in advance.

Posted : 14/07/2025 1:45 pm
Neophyl
(@neophyl)
Illustrious Member
RE:

Open Prusa Slicer, make sure you are in expert mode so can see all the settings.  Then go to Print Settings>Output Options.  In there are check boxes for Verbose G code and also Label Objects.  When on those options will add more comments to the output gcode.  Don't forget to save the update to the preset.

Once other alternative thing you can do is in Printers >Custom Gcode, is find the Between Objects G-code (for sequential printing) field and add a comment in there such as   "; Comment - next Object" (without the quote marks but with the semi colon to denote a comment).  Then you can just search the gcode text file for that string. Simple easy way to jump between blocks for each object.

Also no project attached.  You have to zip up files such as 3mf projects for the forum to accept them.

Posted : 14/07/2025 4:39 pm
3 people liked
UjinDesign
(@ujindesign)
Estimable Member
Topic starter answered:
RE: Finding objects in G-code with sequential printing enabled

Thanks a lot, smart idea to leave a comment between each object! 

Posted : 14/07/2025 5:48 pm
Sembazuru
(@sembazuru)
Noble Member
RE:

You don't describe what settings you are changing, but if they are all in the printer/extruder settings, you may want to consider using multiple extruders. Here is an example that I made last week to try out different retraction amounts:

RetractionTowers_0.0-0.9

My MK4S doesn't actually have 10 extruders, but note that the custom G-Code for tool change is empty so all the printer sees at a tool change is T0, T1, T2, etc. that it ignores. Also, note that I have the wipe tower turned off in the Print Settings. (The observant will notice that the extruder colors are the resistor color code. 😉 )

See my (limited) designs on:
Printables - https://www.printables.com/@Sembazuru
Thingiverse - https://www.thingiverse.com/Sembazuru/designs

Posted : 14/07/2025 11:48 pm
Share: