This is a model for a bog-standard 4-inch outdoor electrical junction box. It should work great for things like motion-sensing lights (what I'm personally using it for) overhead lighting fixtures, and whatever else you use round electrical junction boxes for (I honestly have never used them for anything but lights).
There's two versions of the model: One for 1/2-inch PVC conduit threads and one for 3/4-inch PVC threads but you should be able to customize it pretty easily via the included .scad file. Hint: You probably want the 1/2-inch version (that's what you'd get if you bought something similar at the hardware store).
Note: You'll need the OpenSCAD Threads library to use the included .scad file: http://dkprojects.net/openscad...
Both models have the same (standard) screw hole layout and should work with #10 screws (which is what you're supposed to use with these fixtures). The outside mounting screw holes are slightly larger in order to be more appropriate for screwing the box to your house or whatever (using common exterior screws).
I highly recommend you use some dielectric grease around the perimeter (top) and in the hole threads when screwing things into them to ensure everything stays water-tight. You also might want to use some washers when screwing the box to a wall/ceiling/whatever.
Note: For this to be compliant with the US National Electrical Code (if using 110-120V) you need to print it in a flame-retardant filament (or resin) that is UV-stable (i.e. it won't degrade in the sun). Alternatively, you could just coat it in some UV-blocking paint or spray (e.g. Krylon UV Protect Gloss which is what I'll be using).
Minor update (20180525): I updated the .scad to use 'inside=true' for the threads since that's the correct value for that type of thread. Just increases the size of the theaded holes ever so slightly to more correctly match the NPT spec. The models have been re-re-rendered and updated as well.
I TAKE NO RESPONSIBILITY IF YOU INJURE YOURSELF OR ANYONE ELSE OR IF YOU START A FIRE USING THIS MODEL. YOU HAVE BEEN WARNED.
I recommend printing in 0.3mm resolution (3+ perimeters) because it'll be nice and strong and print faster. I've found that 15% rectlinear infill is strong enough but if you're going to be hanging something heavier (e.g. all metal three-light motion sensing monster) I recommend bumping that up a bit. You might also want to increase the wall_thickness in the .scad and render something custom for really beefy attachments.