Update 21-Jul-2015: Updated to Ulrich’s V2.0 screw_maker. More fasteners and nuts!
Update 01-Oct-2015: Add Bill-Of-Material generation
Many times when I design parts in FreeCAD (Specially Sheet Metal) I need to add standard fasteners such as screws, press-nuts, stand-offs etc… I used to add them manually, usually just as a rough shape, just to have it in the drawing for clearance. Fortunately, volunteers from the FreeCAD community begun to release addons to generate such standard parts automatically. One of these addons is the very nice macro by Ulrich Brammer, that generates several types of screws with high accuracy and conformance with the standard.
To make it easier to use, and also conform with parametric nature of FreeCAD, I decided to write a simple workbench wrapper with WYSIWYG Icons and some controls.
Installation:
Starting from Frecad 0.17, The installation is simple and done using FreeCad’s Add-on manager (Under ‘Tools’ menu)
For off-line manual installations:
Download this file: FastenersWb
Extract the file into FreeCAD Mod directory.
(On Windows its somewhere like “C:\Program Files\FreeCAD 0.18\Mod”, On Linux: “~/.FreeCAD/Mod” , create it if not exist)
That’s it.
Under the Mod directory you should see a new directory called Fasteners:
How to use:
Usage is pretty straightforward:
Start a new document in FreeCAD. Select the Fasteners workbench from the drop-down list.
A series of screws will show on the toolbar:
Simple Usage:
Clicking on any of the screws will create this screw in the origin position with default size. To change size/length select the newly created screw, then go to the data tab in the property panel, there you can change diameter and length. (For now it is in metric standard):
Changing the “thread” property to “true” will render the screw threads as well. Please note that generating threads takes considerable amount of time, during which, FreeCAD will not be responsive.
The invert and offset properties are only applicable to attached fasteners. See next.
Attached fasteners:
Fasteners can also be attached to features in other parts. To attache a screw to a part, the part must have features with circular edges, such as holes. To attach screws to holes, select the desired circular edge or several edges (You can also select a face if you want to select all holes in that face):
Now click on the desired screw. A screw will be placed on each of the selected features, trying to match the screw size to the hole size:
You can now, like before, change diameter and length from the properties panel. If you wish the screw to hover above the hole, you can set the “offset” property to the desired distance. Sometimes the screw does not detect the direction correctly and appears upside down. To correct this change the “invert” property to true, or select the screw and press the Flip button () in the toolbar.
To attach an existing fastener to a different feature, select the screw, then control-select the new feature:
Now press the Move button () in the toolbar. The screw will move to the new location:
An attached screw will move with the part it is attached to. If you wish to detach the screw from the parent part, simply select only the screw, then press the move button. The screw is now detached and can be moved individually.
Simplifying objects
It is important to note that if you wish to share FCStd files that contains fasteners (or parts from other custom parametric workbenches) with other people, they must install these workbenches as well, or else they will get errors when trying to use them.
However, if you just want to share the resulting parts, with no need to change object’s parameters, you can use the Simplify () function, to convert the fasteners to simple shapes. They will appear as new Shape parts in the model tree. You can then delete the original fasteners and save as a simple FCStd that can be read and used on any FreeCAD installation.
Source Code:
For those who are interested, GitHub code can be found here.
Future planned features:
The current workbench is just a wrapper to the screw_maker macro. As so it shows only screws (and a washer). I hope to soon add some press-nuts(added), studs(added) and stand-offs(added).
Once again, many thanks to Ulrich Brammer for his great screw maker macro.
That’s all folks!
Hope it helps.