]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[PythonAPI / sketcher] small updates in sketcher API
authorRenaud NEDELEC <renaud.nedelec@opencascade.com>
Tue, 3 Nov 2015 10:38:09 +0000 (11:38 +0100)
committerRenaud NEDELEC <renaud.nedelec@opencascade.com>
Tue, 3 Nov 2015 10:38:09 +0000 (11:38 +0100)
src/PythonAPI/model/sketcher/line.py
src/PythonAPI/model/sketcher/sketch.py

index eb8d735e022f00ad7c554f5d49323c966ae23d2c..5ba8333a6873ebd4f692da2507f53626d4f758f6 100644 (file)
@@ -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:
index 254d515ad4be3dd71abb382bc6a1e3a2e1b1fe79..9920cfd1111d15df0743bd16a03739cf75ae67af 100644 (file)
@@ -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."""