From 456b8bb1b32c8c388b16d02ac9d7e1905f36b038 Mon Sep 17 00:00:00 2001 From: spo Date: Fri, 30 Oct 2015 17:31:52 +0300 Subject: [PATCH] Remove _selection member from Sketch. --- src/PythonAPI/model/sketcher/sketch.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/PythonAPI/model/sketcher/sketch.py b/src/PythonAPI/model/sketcher/sketch.py index 58b582d4d..a47759071 100644 --- a/src/PythonAPI/model/sketcher/sketch.py +++ b/src/PythonAPI/model/sketcher/sketch.py @@ -54,9 +54,6 @@ class Sketch(Interface): assert(self._norm) assert(self._external) - # Entities used for building the result shape - self._selection = None - if not args: return @@ -310,17 +307,17 @@ class Sketch(Interface): geometry of this Sketch. """ if len(args) == 0: - self._selection = modelAPI_ResultConstruction( + wire = modelAPI_ResultConstruction( self._feature.firstResult() ).shape() elif len(args) == 1: - self._selection = args[0].shape() + wire = args[0].shape() else: raise Exception("not yet implemented") # TODO: simple version now, should be a list of selected faces - return [Selection(self.result(), self.buildShape())] + return [Selection(self.result(), self.buildShape(wire))] - def buildShape(self): + def buildShape(self, wire): """Build the result Shape of this Sketch according to the selected geometrical entities.""" o = self._origin.pnt() @@ -329,7 +326,7 @@ class Sketch(Interface): # The faces are kept otherwise they are destroyed at exit faces = ShapeList() - GeomAlgoAPI_SketchBuilder.createFaces(o, dx, n, self._selection, faces) + GeomAlgoAPI_SketchBuilder.createFaces(o, dx, n, wire, faces) # TODO: Deal with several faces return faces[0] -- 2.39.2