@idslk That's a great script but the problem that rears it's head is that the different types of fasteners don't have the same bolt lengths.
SHCS start at M3 but G8.8 Hex bolts start at M8. Cheeseheads only go to M6. Slotted flat heads to M12, all according to the fastener catalogue I am referencing. I accept that these are only common ones and not an exhaustive list.
In light of this, I think that letting the designer look up the available lengths for the type and class/grade of bolt they intend to use is an easier option.
As I have built a menu to offer the option of washer/
washer/nut as well as a bolt, I have added a window with the width of a washer/nut combo in the size selected to help the user choose a bolt long enough if the last 2 options are selected.
Anyway, I'm happy with it and here it is. It expects to be run inside an assembly as it is building a sub assembly for your convenience.
Note: The final edit has been done with Beta 2019 so I hope it works for anyone wanting to try it out and I apologise if having done so causes it fail.