diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2016-06-15 13:33:41 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2016-06-15 13:33:41 +0200 |
commit | cdd68eb10a962891a2cc2c1e1e05986ab046abf8 (patch) | |
tree | d4136deea1a8ecc70b08843e12b2c0fb24b59563 | |
parent | 991bd588112372a91f63b272b5c507582ba9d4f7 (diff) | |
download | freecad-boxer-cdd68eb10a962891a2cc2c1e1e05986ab046abf8.tar.gz freecad-boxer-cdd68eb10a962891a2cc2c1e1e05986ab046abf8.tar.bz2 freecad-boxer-cdd68eb10a962891a2cc2c1e1e05986ab046abf8.tar.xz freecad-boxer-cdd68eb10a962891a2cc2c1e1e05986ab046abf8.zip |
o Not showing the 2d views after generation.
-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, |