This is a magnet insert for the standard models in Star Wars Legion. It fits 6x2mm magnets.
Depending on the tolerances of your printer and the precise size of your magnets, you may need a little super glue to keep the magnet in place or it might just friction fit.