From: Renaud NEDELEC Date: Tue, 3 Nov 2015 10:38:09 +0000 (+0100) Subject: [PythonAPI / sketcher] small updates in sketcher API X-Git-Tag: V_2.1.0~206^2~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f7fdc57ae808ecd65a1c3e8ad7d3d8bdffdd4c1c;p=modules%2Fshaper.git [PythonAPI / sketcher] small updates in sketcher API --- diff --git a/src/PythonAPI/model/sketcher/line.py b/src/PythonAPI/model/sketcher/line.py index eb8d735e0..5ba8333a6 100644 --- a/src/PythonAPI/model/sketcher/line.py +++ b/src/PythonAPI/model/sketcher/line.py @@ -16,11 +16,10 @@ class Line(Interface): self._feature.data().attribute("EndPoint") ) - # Check that input arguments are not None + # If no arguments are given the attributes of the feature + # are'nt initialized if args is None: - raise WrongNumberOfArguments( - "No argument given, at least one argument needed" - ) + return # Set attribute values and execute if len(args) == 4: diff --git a/src/PythonAPI/model/sketcher/sketch.py b/src/PythonAPI/model/sketcher/sketch.py index 254d515ad..9920cfd11 100644 --- a/src/PythonAPI/model/sketcher/sketch.py +++ b/src/PythonAPI/model/sketcher/sketch.py @@ -55,17 +55,14 @@ class Sketch(Interface): assert(self._norm) assert(self._external) - if not args: - return - - plane = args[0] - - # self.resultype ="Face" # Type of Sketch result - if isinstance(plane, str): - self.__sketchOnFace(plane) - else: - self.__sketchOnPlane(plane) - pass + # If no arguments are given the attributes of the feature + # are not Initialized + if args is not None: + plane = args[0] + if isinstance(plane, str): + self.__sketchOnFace(plane) + else: + self.__sketchOnPlane(plane) def __sketchOnPlane(self, plane): """Create the sketch on a plane."""