<p>Ender 3 Pro, PLA, temps 200 °C and 60 °C.</p>
<p>I want to not heat the nozzle until after Auto Bed Leveling (CR Touch) is complete.  I can do that in the start G-code, but by then, Cura has already heated the nozzle to the temp specified under material and filament starts oozing out during bed leveling.  I'd rather set a variable to that value and call it with <code>M104</code> when I'm ready.</p>
<p>This is the start of Cura's g-code:</p>
<pre><code>;FLAVOR:Marlin
;TIME:2888
;Filament used: 1.96332m
;Layer height: 0.2
;MINX:93.266
;MINY:10.195
;MINZ:0.2
;MAXX:126.734
;MAXY:210.658
;MAXZ:4.2
;Generated with Cura_SteamEngine 4.13.1
M140 S60
M105
M190 S60
M104 S200
M105
M109 S200
M82 ;absolute extrusion mode
; Ender 3 Custom Start G-code
G92 E0 ; Reset Extruder
G28 ; Home all axes
G29 ; Auto Bed Level (CR Touch)
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
...
</code></pre>
<p>The lines right after &quot;Generated with Cura_SteamEngine&quot; are the ones I'd like to change but I can't find them in the Cura app.  I know that 60 °C and 200 °C are the temps defined for bed and nozzle.  Cura inserts them as constants for the <code>M140</code> and <code>M104</code> commands.  I'd like Cura to set variables to those values (like <code>{bed_temp} = 60</code>) so I can refer to that variable when I insert the <code>M140</code> command in my Custom Start G-code.  Can that be done?</p>
<p>A related question was asked a few years ago and part of the start code example then was:</p>
<pre><code>; Ender 3 Custom Start G-code
M104 S{material_print_temperature_layer_0} ; Set Extruder temperature
M140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature
G28 ; Home all axes
G29 ; BLTOUCH Mesh Generation
M190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature
M109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature
</code></pre>
<p>The variable <code>{material_bed_temperature_layer_0}</code> was already set but I don't know where or how that was done.</p>

[{'answer_id': 19412, 'author': '0scar', 'author_id': 5740, 'author_profile': 'https://3dprinting.stackexchange.com/users/5740', 'pm_score': 0, 'selected': False, 'text': '<p>Go to the <code>Settings</code> -&gt; <code>Printers</code> menu from the top menu,</p>\n<p><a href="https://i.stack.imgur.com/jmivX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jmivX.png" alt="enter image description here" /></a></p>\n<p>select your active printer (or <code>Activate</code> it) and manage your printer trough <code>Machine Settings</code>.</p>\n<p><a href="https://i.stack.imgur.com/L3CUC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L3CUC.png" alt="enter image description here" /></a></p>\n<p>It will open the printer settings,</p>\n<p><a href="https://i.stack.imgur.com/rBjqg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rBjqg.png" alt="enter image description here" /></a></p>\n<p>there you are able to change the lines you want in the <code>Start G-code</code> section.</p>\n<p>Note the default Start G-code doesn\'t include heating up the bed and core, you need to add these after the <code>G29</code> in your case. Personally I use heat up bed and continue (<code>M140</code>), than heat up core and wait till temperature is reached (<code>M109</code>), then heat up and wait until bed temperature is reached (<code>M190</code>).</p>\n'}, {'answer_id': 19418, 'author': 'RayW', 'author_id': 34216, 'author_profile': 'https://3dprinting.stackexchange.com/users/34216', 'pm_score': 2, 'selected': False, 'text': "<p>I've sorted this out.  <em>IF</em> I include my own heating commands in my start G-Code, Cura knows to NOT add its own heating commands at the start of the G-Code file.</p>\n<p>The variables I was referring to have dedicated names.\n<code>material_print_temperature_layer_0</code> is the printing (extruder/nozzle) temp set under Material in Cura.\n<code>material_bed_temperature_layer_0</code> is the build plate temp set under Material in Cura.</p>\n<p>Cura substitutes the values of those variables for the variable names in the G-code file.</p>\n<p>So to avoid filament ooze during auto bed leveling, I set the nozzle temp to 150\xa0°C (hot, but lower than the defined printing temp and low enough to avoid ooze).  I set the bed temp to its defined temp.</p>\n<p>Then I auto-level the bed.</p>\n<p>Then I heat the nozzle up to its defined printing temp and start the print job.</p>\n<p>This is my Start G-code:</p>\n<pre><code>; Ender 3 Custom Start G-code\nG92 E0 ; Reset Extruder\nG28 ; Home all axes\nM104 S150 ; Set Extruder temperature for bed leveling\nM140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature\nM109 S150 ; Wait for Extruder temperature for bed leveling\nM190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature\nG29 ; Auto Bed Level (CR Touch)\nM104 S{material_print_temperature_layer_0} ; Set Extruder temperature\nM109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish\n</code></pre>\n<p>And this is how Cura writes the G-code file:</p>\n<pre><code>;FLAVOR:Marlin\n;TIME:2888\n;Filament used: 1.96332m\n;Layer height: 0.2\n;MINX:93.266\n;MINY:10.195\n;MINZ:0.2\n;MAXX:126.734\n;MAXY:210.658\n;MAXZ:4.2\n;Generated with Cura_SteamEngine 4.13.1\nM82 ;absolute extrusion mode\n; Ender 3 Custom Start G-code\nG92 E0 ; Reset Extruder\nG28 ; Home all axes\nM104 S150 ; Set Extruder temperature for bed leveling\nM140 S60 ; Set Heat Bed temperature\nM109 S150 ; Wait for Extruder temperature for bed leveling\nM190 S60 ; Wait for Heat Bed temperature\nG29 ; Auto Bed Level (CR Touch)\nM104 S200 ; Set Extruder temperature\nM109 S200 ; Wait for Extruder temperature\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish\nG92 E0\n...\n</code></pre>\n<p>I hope this helps someone with a similar question.</p>\n<p>Cheers.</p>\n"}]
['https://3dprinting.stackexchange.com/questions/19411', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/34216/']