shaise / FreeCAD_FastenersWB

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

Fix bug when generating BOM #368

Closed Syres916 closed 5 months ago

Syres916 commented 5 months ago

Fixes this error, reported on forum https://forum.freecad.org/viewtopic.php?t=87169:

Running the Python command 'Fasteners_BOM' failed: Traceback (most recent call last):
  File "/home/john/.local/share/FreeCAD/Mod/fasteners/./FastenerBase.py", line 897, in Activated
    method(obj, cnt)
  File "/home/john/.local/share/FreeCAD/Mod/fasteners/./FastenerBase.py", line 915, in AddScrew
    " Screw ") + FSScrewStr(obj)
  File "/home/john/.local/share/FreeCAD/Mod/fasteners/./FastenerBase.py", line 184, in FSScrewStr
    if isinstance(dia, FreeCAD.Units.Quantity):

local variable 'dia' referenced before assignment
shaise commented 5 months ago

Thanks! Really? A code line slipped into the comment lines?