A coworker had a pencil holder he designed like this on his desk at work. My son mentioned he wanted something similar, so I made my own version. It is an easy 3d print with a color change at layer 1.2mm and back at layer 3.2mm. Then glue one 6mm x 3mm Magnet under the cap and into the top.
When gluing the leg into the base and the top magnet pod on top of the leg, do some testing first to dial in the locations. Make sure the pen will be held vertical and centered over the base, and that the vertical distance holds the pen securely without fully lifting the pen up to the magnet.
Video In Action: https://www.youtube.com/shorts/6N1HksgC9_4
*Note this is based off a design by my coworker Dan Lohse, his design is not posted anywhere or I would link to it.
The author marked this model as their own original creation.