Skip to content

Commit

Permalink
Update MainSlabReinforcement.py
Browse files Browse the repository at this point in the history
should hopefully solve #212
  • Loading branch information
balrobs authored Jun 3, 2024
1 parent beb3610 commit ae2e8b3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion SlabReinforcement/MainSlabReinforcement.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
import FreeCAD
import FreeCADGui

from Rebarfunc import check_selected_face
from Rebarfunc import (
check_selected_face,
facenormalDirection,
showWarning
)
from SlabReinforcement.SlabReinforcement import (
makeSlabReinforcement,
editSlabReinforcement,
Expand Down Expand Up @@ -992,6 +996,12 @@ def CommandSlabReinforcement():
"""This function is used to invoke dialog box for slab reinforcement."""
selected_obj = check_selected_face()
if selected_obj:
# check if selected face is horizontal. If so, later execution will fail with error
normal = facenormalDirection()
is_horizontal = FreeCAD.Vector(0, 0, 1).getAngle(normal) < 0.01
if is_horizontal:
showWarning("Error: Select a vertical slab surface!")
return
dialog = _SlabReinforcementDialog()
dialog.setupUi()
dialog.form.exec_()

0 comments on commit ae2e8b3

Please sign in to comment.