diff options
-rw-r--r-- | Boxer.py | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -120,8 +120,6 @@ class NotchConfig(object): class BoxCfg(object): def __init__(self): - print('BoxCfg.__init__') - # yapf: disable self.sides = { SideType.front: BoxSide(self, 'Front', MeasurementDirection.width, MeasurementDirection.height, SideSize.large, (0, -1, 0), @@ -184,7 +182,6 @@ class BoxCfg(object): self._notchSize = notchSize def sideForType(self, sideType): - #print('sideForType: sideType=' + str(sideType)) return self.sides[sideType] def outerDimmensions(self, width, height, depth): @@ -269,8 +266,6 @@ def line(cfg, start, boxSide, lineDirection, notchConfig, innerLength): left = boxSide.left(lineDirection) right = boxSide.right(lineDirection) - print('line: lineDirection=' + str(lineDirection) + ', opposite=' + opposite.title + ', left=' + left.title + ', right=' + right.title) - inv = -1 if sideSize.inv(lineDirection) else 1 includeStart = sideSize.includeStart(lineDirection) @@ -297,8 +292,6 @@ def line(cfg, start, boxSide, lineDirection, notchConfig, innerLength): def makeBoxSide(cfg, boxSide): - print('makeBoxSide: boxSide=' + boxSide.title) - notchConfigX = cfg.notchConfig(boxSide.directionX) notchConfigY = cfg.notchConfig(boxSide.directionY) innerLengthX = cfg.innerLength(boxSide.directionX) @@ -423,9 +416,9 @@ def makeShape2DViews(doc, cfg, extrudes): def makeShape2DView(extrude, sideType): boxSide = cfg.sideForType(sideType) - print('pvs[sideType]=' + str(pvs[sideType])) s = Draft.makeShape2DView(extrude, projectionVector = pvs[sideType]) s.Label = boxSide.title + ' View' + s.ViewObject.Visibility = False return s objects = {} @@ -454,8 +447,12 @@ def make(doc, cfg): views = makeShape2DViews(doc, cfg, extrudes) viewsGroup = doc.addObject("App::DocumentObjectGroup", "Views") viewsGroup.Label = 'Views' - for sideType, view in views.items(): - viewsGroup.addObject(view) + for sideType in SideType: + try: + view = views[sideType] + viewsGroup.addObject(view) + except KeyError: + pass return { 'parts': parts, |