Permalink
Browse files

added checks when sketch support is empty

  • Loading branch information...
amrit3701 committed Jun 23, 2017
1 parent 5d9467e commit 70dbced59d68cef6c13c07b238b8a0e3cee3b4fb
Showing with 7 additions and 0 deletions.
  1. +4 −0 StraightRebar.py
  2. +3 −0 UShapeRebar.py
View
@@ -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]
View
@@ -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]

0 comments on commit 70dbced

Please sign in to comment.