This knob, designed by nophead can be adapted for exporting to various sizes of nuts. See nophead's blog post for more information. In an e-mail sharing the aoi file he said the following:
"I assume you have AOI so can make the STL. I have been meaning to put it on the objects wiki but have not got round to it. If published it really needs a table of scaling factors for various nut sizes, or an array of STLs. Also BA nuts are thicker than metric so it may need a bit slicing off the end. You will have to play around with scaling it because it was for 2BA, but was a bit tight as internal holes come out a lot smaller than they should be. This seems to depend on the filament width and the type of plastic. I also think how much you stretch it will have an effect. Adrian published corrections for circles but I get an order of magnitude more error that that formula. It is something on my list of things to research and quantify."
Note: The current STL file (see right sidebar) is only for a 2BA nut. Please export other sizes and post them here if you get around to it.