shaise / FreeCAD_FastenersWB

A workbench to add/attach various fasteners to parts
GNU General Public License v2.0
279 stars 85 forks source link

AutoDiameter fails if hole is too large #381

Open Roy-043 opened 4 months ago

Roy-043 commented 4 months ago
  1. Create a hole with a diameter of 100mm (users can do strange things... :wink:)
  2. Select the circular edge.
  3. Insert a fastener, for example DIN571.
  4. Result: Error message see below.
21:53:37  pyException: Traceback (most recent call last):
  File "C:\Users\Name\AppData\Roaming\FreeCAD\Mod\fasteners\.\FastenersCmd.py", line 669, in execute
    self.calc_diam = screwMaker.AutoDiameter(
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Name\AppData\Roaming\FreeCAD\Mod\fasteners\.\ScrewMaker.py", line 487, in AutoDiameter
    return res
           ^^^
<class 'UnboundLocalError'>: cannot access local variable 'res' where it is not associated with a value
21:53:37  Screw: cannot access local variable 'res' where it is not associated with a value
shaise commented 4 months ago

Thanks! I'll take a look.

shaise commented 4 months ago

Should be fixed now.