<p>I want to print this <a href="https://www.thingiverse.com/thing:2213410" rel="nofollow noreferrer">heat tower calibration test</a>.</p>

<p>The instructions say to change the temperature every 25 layers. It also tells me to use G-Code command <code>M104 Sxxx</code></p>

<p>First, is there a way to specify this command using Ultimaker Cura?</p>

<p>If not, how do I do so in the G-code file? </p>

<p>I see that the G-code file is just a plain text file with a command per line presumably. Do I just insert <code>M104 S225</code> at one point and then <code>M104 S220</code>...? 
If so, how do I know where the 25th layer is?</p>

[{'answer_id': 7976, 'author': 'Demis', 'author_id': 2383, 'author_profile': 'https://3dprinting.stackexchange.com/users/2383', 'pm_score': 2, 'selected': False, 'text': '<p>Every time you see a Z movement that matches the layer height (eg. 0.20&nbsp;mm) you can assume that is the end/start of one "layer".\nIt should have a line like:</p>\n\n<pre><code>;Layer count: 17\n;LAYER:0.  ; mine has this as the first layer\nM107\nG0 F2400 X67.175 Y61.730 Z0.250. ;  moves to Z0.250 mm for the first layer, with layer thickness 0.25 mm\n</code></pre>\n\n<p>Then later:</p>\n\n<pre><code>;LAYER:1\nM106 S255\nG0 F2400 X78.078 Y69.627 Z0.550 ; 2nd layer.\n</code></pre>\n\n<p>So search for "Z" or "Layer" and once you\'ve seen 25 of these "small" movements (comparing to previous Z movement?), insert your line of code at the end of the layer commands.  Don\'t confuse it with large Z-movements, that may correspond to move up/retract filaments.\nDepending on your goals for the print, maybe you also want to insert a wait time - say a minute or two for the new temp to stabilize?  Here is the line for that:</p>\n\n<pre><code>G4 P200  ;  Sit still doing nothing for 200 milliseconds.\n</code></pre>\n'}, {'answer_id': 7994, 'author': 'anaximander', 'author_id': 9214, 'author_profile': 'https://3dprinting.stackexchange.com/users/9214', 'pm_score': 2, 'selected': False, 'text': '<p>Under the Extensions menu in Ultimaker Cura, there\'s an option to add <a href="https://ultimaker.com/en/resources/20442-post-processing-plugins" rel="nofollow noreferrer">post-processing scripts</a>. One of these is called TweakAtZ, and it allows you to override certain print settings when the printer reaches a certain Z height. Multiple overrides can be specified for different heights.</p>\n\n<p>TweakAtZ has been bundled with the standard Ultimaker Cura download for some time, but if your version doesn\'t have it, you can <a href="https://github.com/Dim3nsioneer/Cura-Plugins/wiki/Tweak-At-Z-plugin" rel="nofollow noreferrer">download it from GitHub</a>.</p>\n'}]
['https://3dprinting.stackexchange.com/questions/7975', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/13712/']