Embedding magnets, nuts and tags mid-print
Pausing a print, dropping an object into a pocket and letting the printer close the lid over it gives a part with no glue, no visible hole and nothing that can fall out. It needs three things to go right: a pocket the object drops into without standing proud, a pause on exactly the right layer, and a pause command that parks the nozzle instead of letting it sit on the print.
Embed, press in or glue?
An object can go into a print three ways:
- Press-fit into an open hole after printing. Simplest, no pause; the object stays visible and can work loose. This is how the magnet holes in Gridfinity bins are usually filled.
- Glue into an open pocket, sometimes under a printed cap. Easy, but the joint is visible and the glue is the weak point.
- Embed during a pause: the printer stops, you insert the object, and the next layers seal it in. Invisible, secure, and the only option for objects that must be fully enclosed. It costs a few minutes at the printer and a little planning.
Embedding suits magnets in lids and toys, nuts behind a clean surface, weights in bases, NFC tags in key fobs and coasters, and anything that must not be removable.
Sizing the pocket
Diameter or width. Printers make holes smaller than modelled, typically by 0.1–0.3 mm. For a drop-in fit, add that shrinkage plus about 0.2 mm of slip. A 6 × 2 mm magnet on a printer that shrinks holes by 0.2 mm needs a 6.4 mm hole to come out at about 6.2 mm. Measure your own shrinkage once with a test print; the tolerance guide explains why holes shrink.
Hex nuts. Size the pocket across the flats, not the corners. An M3 nut is 5.5 mm across flats and 2.4 mm high, so a pocket of about 5.9 × 2.6 mm is a reasonable start on a printer with 0.2 mm hole shrinkage. Align one flat with the X or Y axis so the straight sides print cleanly.
Depth and headroom. The object must sit completely below the top of the pocket, or the nozzle will hit it. Make the depth the object height plus 0.2 mm, then round up to a whole number of layers. Magnet thickness varies a little between batches, so measure a few.
Position. Keep at least two or three walls of solid plastic around the pocket and a few solid layers below it. If the pocket sits in infill, the object can push through the floor when you press it in.
A 6 × 2 mm magnet, 0.2 mm layers, the pocket floor at 1.0 mm. Depth 2.0 + 0.2 = 2.2 mm, which is exactly 11 layers, so the pocket top is at 3.2 mm. The last open layer is the one ending at 3.2 mm (layer 16); the pause goes before the layer from 3.2 to 3.4 mm (layer 17), the first that roofs the pocket.
Finding the layer to pause at
The pause must come after the last layer that still has the pocket open and before the first layer that covers it. If it comes too early, the pocket is not deep enough yet and the object sticks out. If it comes too late, the pocket is already closed.
The reliable way is the slicer preview, not arithmetic. Slice, move the layer slider to the top of the pocket, and step until the layer that first bridges across it appears. That is the pause layer. Step back one layer and check that the pocket is open and full depth. Slicers differ in whether a pause is inserted "at" or "before" a selected layer and in how they count layers, which is why the preview check matters; the same caution applies to colour changes in finding the colour-change layer.
If the first layer height differs from the rest, layer numbers and heights no longer line up neatly. Work from the heights the preview shows.
The cap layers above the object
The first layer over the pocket is a bridge across the void, landing partly on the object. Short bridges such as a 6 mm magnet pocket print well; for larger pockets, check the bridge settings in the bridging guide. Then:
- Three to five layers above the object (0.6–1.0 mm at 0.2 mm layers) give a flat, closed surface. Fewer layers show the outline of the pocket; more hide it completely.
- Magnets hold best through a thin cap, because their pull falls off quickly with distance. If two parts are meant to snap together magnetically, keep the cap at two or three layers on the mating faces.
- A captured nut needs the screw hole to continue above it. A round hole over a hex pocket leaves loose loops; use the stepped bridges or the one-layer membrane described in the sacrificial layer trick.
- NFC tags read through a few layers of plastic. Keep the cap thin and keep metal objects away from the tag; the NFC keychain generator shows a typical round-tag pocket.
How thick the cap over an NFC tag can be, and what else reduces the read range, is covered in NFC tags inside 3D prints.
Pause commands by slicer and firmware
All the common slicers can insert a pause at a layer; what happens when the printer reads it depends on the firmware and the printer profile.
- PrusaSlicer: in the preview, use the plus icon on the layer slider and choose the pause option. It inserts the printer profile's pause G-code; on Prusa printers this is M601.
- OrcaSlicer and Bambu Studio: right-click the plus icon on the layer slider and choose to add a pause. The command comes from the machine profile's pause G-code setting.
- Cura: Extensions → Post Processing → Modify G-Code, add the Pause at height script, and set the height or layer. The script includes parking, retraction and the pause method for your firmware. Remove it afterwards, as it stays in the profile.
- Klipper: the usual command is
PAUSE, resumed withRESUME, which needs the pause-resume feature in the configuration. Whether the head parks depends on your macros; make sure the slicer's pause G-code calls a macro that parks. - Marlin: depends on how the firmware was built. M600 parks the head but may also unload the filament, which is awkward but works. M0 waits for a button press on the display but does not park by itself, leaving the hot nozzle sitting on the print.
Two settings to check before the first attempt: that the pause parks the head away from the print, and how long the heaters stay on while paused. Some firmware turns heaters off after an idle timeout, and a print that has cooled may lose adhesion. The G-code guide covers the commands themselves.
At the printer: the pause step by step
- Before the print, lay out the objects, check that each one fits a test pocket, and note the time when the pause will happen.
- When the printer pauses, do not touch the bed or the part, and do not move the head. Pushing on a bed-slinger's bed or nudging the part can cause a layer shift.
- Insert each object with tweezers or a stick, and press it to the bottom of the pocket. Check that nothing stands proud: slide a flat ruler across the top.
- Remove any strings or blobs near the pockets; the nozzle may have oozed while parked.
- Resume and watch the first layer over the pockets. If the nozzle catches an object, stop at once.
Magnet polarity
Two parts that should attract each other repel if one magnet goes in the wrong way round. Plan it before printing:
- Mark a reference magnet with a dot of marker on one face. Use it to check every magnet before insertion: the face that attracts the dot's face is the opposite pole.
- Identical parts printed the same way up repel. When part A is placed face-down on part B, the face that was up in A meets the face that was up in B. If all magnets went in with the same pole up, they meet like poles. Insert them with the opposite pole up in one of the two parts.
- Parts that must mate either way round need a pattern: alternate north-up and south-up magnets so that the pattern still matches after the flip.
- Keep loose magnets apart during the pause. Strong magnets snap together, and they are hard to separate with gloves on.
Problems and safety
- The nozzle hits the object: too little headroom, pause one layer early, or the object lifted. Add depth and recheck the pause layer.
- Magnets jump out of their pockets: a steel nozzle or steel parts on the toolhead can attract them. A tiny drop of glue in the pocket holds them down.
- Visible line where the pause happened: the part cooled and the nozzle oozed; shorten the pause, check that heaters stay on, and wipe the nozzle before resuming.
- Poor bond above the pause: see the notes on paused prints in multicolour without AMS.
- Sagging cap: pocket too wide for a clean bridge; add more cap layers or tune bridging.
Small strong magnets are dangerous if swallowed: two magnets, or a magnet and a piece of metal, can attract each other through the walls of the intestine. Fully embed magnets in toys and items children can reach, use enough cap layers that they cannot be chewed or broken out, and do not use lead weights in items that are handled; steel works for weighting.
Frequently asked questions
How big should a magnet pocket be?
For a magnet dropped in during a pause, model the hole about 0.4 mm larger than the magnet: roughly half of that is lost to the printer shrinking holes, and the rest is the gap that lets it drop in. Make the depth the magnet thickness plus about 0.2 mm, rounded up to whole layers, so the magnet never stands above the pocket.
At which layer should I pause to insert a magnet?
At the first layer that covers the pocket. In the slicer preview, step through the layers until the pocket is roofed over for the first time and add the pause there; the layer below should still show the pocket open. The pause then happens after the pocket walls are complete and before the cap starts.
Why did the nozzle hit the magnet after resuming?
The magnet stood above the top of the pocket — the pocket was too shallow, not rounded up to a whole layer, or the magnet was not pushed fully down or was pulled up by a steel part on the toolhead. Add depth, press each object down, and use a drop of glue if magnets jump.
Will the heat of printing damage the magnet?
Usually not. The nozzle passes over the magnet only briefly. Standard-grade neodymium magnets are typically rated to around 80 °C, so a bed at 60 °C is fine; with hotter beds or enclosed chambers, choose a higher-temperature grade or keep the magnet higher in the part.
Can I embed an NFC tag the same way?
Yes. A thin round tag in a shallow pocket, covered by a few solid layers, reads through plastic without problems. Keep metal objects away from the tag and keep the cap thin. The NFC keychain generator uses an open pocket instead, for gluing the tag in after printing.