<p>Tired of waiting, the print is now 40% done and seems to be just fine.</p>
<p>Thinking through my own problem more, there are three other things I might want to check (other than base speeds, as mentioned in the question) if I do this in the future:</p>
<ol>
<li>Cooling. Some materials need the cooling fan set differently. This should also be a single line edit near the top of the file.</li>
<li>Retraction. Some materials need different retraction settings to control stringing, and in fact I do find I often need retraction to be a little more aggressive for PET-G vs PLA, even if this one print came out okay. This change is needed for every retraction instruction, instead of just once at the top of the file, but I could probably adjust it via a simple find/replace in the file.</li>
<li>Travel Speed. Some materials need faster travel moves, also for stringing.  This manages a trade-off between speed and quality. One <em>could</em> just always set for the fastest travel speed, which both improves print times and stringing, but faster travel moves sometimes result in ringing/ghosting at the corners, and so there's a balance that can be different per material type. This <em>might</em> be adjustable with a find/replace, but I would want to read through the file some to be sure we don't use similar gcode/speed numbers for anything else. It may also be possible to use strong accelleration/jerk controls to compensate for consistently faster travel moves, in which case I could set my slicer to use fast speeds that still always work, regardless of material.</li>
</ol>

CC BY-SA 4.0
2022-09-29T17:53:45.610Z
With [`M220`](https://marlinfw.org/docs/gcode/M220.html) you can alter the speeds, so that would take care of PLA to PETG difference in speed. Note that sometimes fan speeds are increased for printing overhangs or small areas. How are your Python skills! ;-) That should fix this fast!
0scar
CC BY-SA 4.0
2022-09-29T18:32:01.517Z
@0scar I'd go for PowerShell (or even C#), but the coding wouldn't be a problem :)
Joel Coehoorn
CC BY-SA 4.0
2022-09-29T20:19:20.360Z
Indeed, what you're doing should work fine, and thinking about it exposes how misleading slicers are about the need for profiles. For the most part, gcode is not just material independent but even *device independent*, and can be made even moreso if you use features like firmware retraction that let you configure more of the variables on the firmware/printer side instead of the slicer.
R.. GitHub STOP HELPING ICE
CC BY-SA 4.0
2022-10-01T18:43:01.480Z
Some slicers have a separate temperature for the first layer, so watch for second set of hotend temp and bed temp commands in the Gcode after the first layer completes. It may sneak back to the PLA temperature.
ChinchillaWafers
CC BY-SA 4.0
2022-10-03T14:50:55.870Z
Yeah, I've actually printed an ABS gcode (editing speed and temps) with porcelain.
Davo
CC BY-SA 4.0
2022-09-29T15:33:54.433Z
2022-10-03T16:19:05.710Z
2022-10-03T16:19:05.710Z
Joel Coehoorn
<p>I had a model I had originally printed in PLA, and then lost the STL... but I still have the G-code. Now I want to print it in PET-G. Do I need to do anything other than update the numbers on the M104 and M90 instructions near the top of the file to set for new hot end and bed temperatures to get it to print properly?</p>
<p>I know some materials I might also need to adjust speeds, but it seems like with PLA&lt;=&gt;PET-G those two items ought to be enough. Is there anything else I should check?</p>

<g-code><print-material>
Editing a G-code file for different material
Joel Coehoorn
# Editing a G-code file for different material

(Asked by: username_0 on 2022-09-29)

I had a model I had originally printed in PLA, and then lost the STL... but I still have the G-code. Now I want to print it in PET-G. Do I need to do anything other than update the numbers on the M104 and M90 instructions near the top of the file to set for new hot end and bed temperatures to get it to print properly?

I know some materials I might also need to adjust speeds, but it seems like with PLA<=>PET-G those two items ought to be enough. Is there anything else I should check?

**Tags:** g-code, print-material


---

## 1 answers

### Answer by username_0 on 2022-09-29. Score: 6 | Accepted answer

Tired of waiting, the print is now 40% done and seems to be just fine.

Thinking through my own problem more, there are three other things I might want to check (other than base speeds, as mentioned in the question) if I do this in the future:

1. Cooling. Some materials need the cooling fan set differently. This should also be a single line edit near the top of the file.
2. Retraction. Some materials need different retraction settings to control stringing, and in fact I do find I often need retraction to be a little more aggressive for PET-G vs PLA, even if this one print came out okay. This change is needed for every retraction instruction, instead of just once at the top of the file, but I could probably adjust it via a simple find/replace in the file.
3. Travel Speed. Some materials need faster travel moves, also for stringing. This manages a trade-off between speed and quality. One *could* just always set for the fastest travel speed, which both improves print times and stringing, but faster travel moves sometimes result in ringing/ghosting at the corners, and so there's a balance that can be different per material type. This *might* be adjustable with a find/replace, but I would want to read through the file some to be sure we don't use similar gcode/speed numbers for anything else. It may also be possible to use strong accelleration/jerk controls to compensate for consistently faster travel moves, in which case I could set my slicer to use fast speeds that still always work, regardless of material.

> **Comments:**
> **username_1**: With [`M220`](https://marlinfw.org/docs/gcode/M220.html) you can alter the speeds, so that would take care of PLA to PETG difference in speed. Note that sometimes fan speeds are increased for printing overhangs or small areas. How are your Python skills! ;-) That should fix this fast!  
> **username_0**: @username_1 I'd go for PowerShell (or even C#), but the coding wouldn't be a problem :)  
> **username_2**: Indeed, what you're doing should work fine, and thinking about it exposes how misleading slicers are about the need for profiles. For the most part, gcode is not just material independent but even *device independent*, and can be made even moreso if you use features like firmware retraction that let you configure more of the variables on the firmware/printer side instead of the slicer.  
> **username_3**: Some slicers have a separate temperature for the first layer, so watch for second set of hotend temp and bed temp commands in the Gcode after the first layer completes. It may sneak back to the PLA temperature.  
> **username_4**: Yeah, I've actually printed an ABS gcode (editing speed and temps) with porcelain.  

---

