This is a pen with an embedded magnet to use as a replacement for magnetic drawing boards, or just for any fun game or science project. You can see a picture of the broken one I used to as inspiration for this model.
Design features
The magnet is completely embedded (it's not as strong as an external magnet, but it can't come out this way).
The cord is also neatly inside the pen once assembled and the knot is not accessible.
Required material
A round 6x1.5mm magnet (actual space is 7x2mm).
2mm cord (actual opening is 2.5mm).
Preparation
Test the magnet on the build plate to see which side is attracted; place that side down when inserting into the model.
Printing
Print as-oriented in the .stl file, using a 0.2mm layer height (recommended).
Insert a pause after layer height 8.0mm.
Insert the magnet with a drop of superglue, making sure it is as close to the tip as possible (towards the left in the model).
Note: The .gcode file I've included has a custom pause algorithm. Upon resume it will extrude a bit and begin a 4 second move to give you time to wipe excess material.
Inserting the cord
Cut the cord neatly, and carefully push the cord through the hole at the end of the pen until it comes out the side opening.
Tie a double overhand knot in the protruding end, and trim it neatly.
Pull it back through from the end; you'll feel some resistance, and then the cord end will be secured inside the pen.
See the third picture for a reference, using Mammut 2mm Hammer Cord.
Safety notes
Magnets can be dangerous if not used properly.
Supervise your children while using this toy.
Other notes
My entire model is parameterized in OpenSCAD. If you'd like any simple modification (magnet size, overall size/length, cord diameter), just send me a message and I'll be happy to help out.