I have a model that contains a cavity, into which I want to insert a piece of metal, so I can use a magnet to stick to the print. How can I introduce a pause into the G-code without manipulating it manually in Ultimaker Cura?
2 Answers
Ultimaker Cura contains "Extensions"; in version 4.1.0, the process is as follows:
- Extensions -> Post Processing -> Modify G-code
- Add a Script -> Pause at height
- Choose the one that matches your firmware!
- Choose the
Pause height
to match the height the insertion should take place. Usually, this is to be the layer just before the roof is to be printed to keep the inserted objects from protruding from their cavities. - Choose a park position well outside of the print. X 10 Y 10 is usually a good position for this.
- Add a little retraction if you want.
In printing, you have to wait till the cavity is formed, insert the item quickly and press the control button to resume. The shorter the pause, the better the next layer will hold to the already printed.
Also, keep in mind to make the cavity a little larger than the insert, both in XY and Z, to compensate for the plastic shrinking a little and to allow the nozzle to pass well over the inserted item.

- 21,915
- 12
- 50
- 101
-
1Note that there are different pausing scripts based on printer type; choose wisely. – 0scar Jul 14 '19 at 12:54
-
Neat trick, but I get the impression that it is actually faster to pop the gcode file into np++ and add a standard line or two of code at the appropriate layer. – Carl Witthoft Jul 15 '19 at 15:39
-
@CarlWitthoft finding the right line is the problem then – Trish Jul 15 '19 at 16:18
-
@Trish once you know the layer number - which you need for the Cura tool -- it's easy to find that in the gcode file. – Carl Witthoft Jul 15 '19 at 17:17
-
1No @carlwitthoft one needs the absolute height, not layer number – Trish Jul 16 '19 at 06:17
-
@Trish why? If you know where the first "roof" layer is, why isn't that sufficient? I've successfully placed a "pause" command that way several times when I wanted to swap filaments at a particular height in a print. – Carl Witthoft Jul 16 '19 at 11:52
-
@CarlWitthoft While for convenience most people print in intervals of 0.1 mm layer height, others use intervals of 0.08 mm or something similar as that's what an exact multiple of steps on their lead screw is. In these cases, and making it independant of a layer count, knowing an absolute height is easier than converting it to the layer. With the same script setting you could print an item in 0.1 mm as well as 0.3 mm layer height without adjustment. Add to that layer 1 is often not the same as any subsequent layer. – Trish Jul 16 '19 at 17:18
-
1Please note that the printer firmware must be able to handle the inserted G-codes. Please see [this answer](/a/11242), it shows that if a firmware that does not support the inserted G-codes is loaded onto the machine, the inserted Cura scripts will not work. – 0scar Nov 25 '19 at 12:07
This answer already explains how you insert the G-codes to enable a pause into your model. But, this will only work if the printer supports the G-codes that are inserted by Cura. E.g. this question shows that this does not always work!
To pause the printer you would need to resort into other methods, e.g. a manually inserted G4
(Dwell) would be a viable solution as shown in this answer.