From cdd68eb10a962891a2cc2c1e1e05986ab046abf8 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 15 Jun 2016 13:33:41 +0200 Subject: o Not showing the 2d views after generation. --- Boxer.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Boxer.py b/Boxer.py index b31098d..7e1c13a 100644 --- a/Boxer.py +++ b/Boxer.py @@ -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, -- cgit v1.2.3