I do not know how guns are manufactured, but from the comments in this and earlier discussions of the story, I assumed that there are parts with common characteristics.
As a result, and unless the resulting 3D models are too many, or if they would result in false positives with legitimate applications, you could require that 3D printers and CAD software refuse to work with them.
Based on the couple of comments below, however, it seems that my assumption that there is a sufficiently common part among firearms is wrong, so I'll leave further comments to the experts.
You have to spend money somewhere for it to be useful. With guns, nobody has to accept being shot, they just are.
Another thing is there is no possible way this could be enforced before strong AI that can recognize a functioning gun somehow.
But there's a huge space of possible gun designs. Don't we need a large advance in technology to be able to determine something is a gun? Especially if we don't accept a lot of false positives?
Of course, with the more DIY and open nature of 3D printers this might be difficult to enforce, but not impossible, at least for the average user.