amrit3701 / FreeCAD-Reinforcement

Reinforcement Workbench for FreeCAD
https://wiki.freecadweb.org/Reinforcement_Workbench
48 stars 19 forks source link

Error in Slab Reinforcement: access local variable 'facename_for_tb_rebars' #212

Open balrobs opened 5 months ago

balrobs commented 5 months ago

when trying to use the Slab-Reinforcement command I see this error:

15:30:45  pyException: Traceback (most recent call last):
  File "C:\Users\balrobs\AppData\Roaming\FreeCAD\Mod\Reinforcement\.\SlabReinforcement\SlabReinforcementObject.py", line 775, in onChanged
    self.makeOrEditSlabReinforcement(obj)
  File "C:\Users\balrobs\AppData\Roaming\FreeCAD\Mod\Reinforcement\.\SlabReinforcement\SlabReinforcementObject.py", line 943, in makeOrEditSlabReinforcement
    cross_facename = getFacenamesforBeamReinforcement(facename, structure)[
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\balrobs\AppData\Roaming\FreeCAD\Mod\Reinforcement\.\Rebarfunc.py", line 722, in getFacenamesforBeamReinforcement
    return facename_for_tb_rebars, facename_for_s_rebars
           ^^^^^^^^^^^^^^^^^^^^^^
<class 'UnboundLocalError'>: cannot access local variable 'facename_for_tb_rebars' where it is not associated with a value

OS: Windows 10 build 19045 Word size of FreeCAD: 64-bit Version: 0.22.0dev.37436 (Git) Build type: Release Branch: main Hash: 040502280fc9637fb3aada037523283168b81a02 Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2 Locale: German/Germany (de_DE) Installed mods:

balrobs commented 5 months ago

ok, realized that this error was generated by not starting to select a vertical but a horizontal face of the slab. Maybe the sentence Select any face of a previously created Slab in the wiki should be changed to Select any vertical face of a previously created Slab. In addition, an initial check could filter out this selection error?