My old MacBook charger kept falling whenever I moved, so I designed this
I'm new to 3D printing and CAD, it's not the best looking, I was going for fast printing. I borrowed a couple of files from the internet to get the dimensions of the charger and the thunderbolt.
You might want to print it laying down, so the layer lines aren't at the breaking to get stuck inside your laptop , but nice altogether! My charger has long died, and I'm using a USB c to mag charger that mostly works (and still disconnects if you look at it funny)
Lying down would be hard to print due to the hollow cavity where the charger goes. You could split it into two separate sections and then glue it together. Easier solution is to model or drill a 2mm hole through the part and glue a piece of filament in place to give it some strength.
The right angle MagSafe chargers are much better if you can find one. They have less leverage in the magnets, plus the cord can come out the back of the laptop, or along side the side, which usually fits better in my use cases.