Skip to content

Commit

Permalink
added checks when sketch support is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
amrit3701 committed Jun 23, 2017
1 parent 5d9467e commit 70dbced
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions StraightRebar.py
Expand Up @@ -102,6 +102,10 @@ def makeStraightRebar(f_cover, b_cover, s_cover, diameter, amount_spacing_check,

def editStraightRebar(Rebar, f_cover, b_cover, s_cover, diameter, amount_spacing_check, amount_spacing_value):
sketch = Rebar.Base
# Check if sketch support is empty.
if not sketch.Support:
showWarning("You have checked remove external geometry of base sketchs when needed.\nTo unchecked Edit->Preferences->Arch.")
return
# Assigned values
facename = sketch.Support[0][1][0]
structure = sketch.Support[0][0]
Expand Down
3 changes: 3 additions & 0 deletions UShapeRebar.py
Expand Up @@ -121,6 +121,9 @@ def makeUShapeRebar(f_cover, b_cover, s_cover, diameter, t_cover, rounding, amou
def editUShapeRebar(Rebar, f_cover, b_cover, s_cover, diameter, t_cover, rounding, amount_spacing_check, amount_spacing_value):
sketch = Rebar.Base
# Assigned values
if not sketch.Support:
showWarning("You have checked remove external geometry of base sketchs when needed.\nTo unchecked Edit->Preferences->Arch.")
return
facename = sketch.Support[0][1][0]
structure = sketch.Support[0][0]
face = structure.Shape.Faces[int(facename[-1])-1]
Expand Down

0 comments on commit 70dbced

Please sign in to comment.