I needed some cup holders for my Jeep. (Apparently, they had not yet invented cup holders in 1985. Go figure.) Since the interior of the Jeep is all metal, it occurred to me that I had a magnetic parts holder from Harbor Freight that I could use to make a cup holder.
I bought some epoxy for $1.49 (https://www.harborfreight.com/super-strong-quick-drying-epoxy-92665.html) and, using a coupon, got the parts holder FREE! (https://www.harborfreight.com/4-inch-magnetic-parts-tray-90566.html)
The cup holder is designed to use the magnet and rubber cover from the dish. Carefully flex the metal dish until the magnet pops off. Then trim off the excess rubber from the magnet.
Print the cup holder. I did not use supports when printing. However, you may need to print with supports if your printer does not bridge well.
Once the object is printed, test fit the magnet in the base of the cup holder. It should be snug. Once satisfied with the fit, use the epoxy to glue the magnet to the cup holder.
This cup holder can also be used on any steel surface, such as tool boxes or other sheet metal.
UPDATE: 6/22/19 - Added a revised version with a narrow base.