Salome HOME
Synchronize displayed objects if Viewer was opened after displaying
[modules/shaper.git] / src / PythonAPI / modeler / sketcher.py
index 5aa7b54adfcb6800188f9afdad73c90e896f8163..c9737224ea2ec566efc24277c2b4c52283aa74f6 100644 (file)
@@ -122,6 +122,7 @@ class Sketch():
     constraint = self.my.addFeature("SketchConstraintLength")
     constraint.data().refattr("ConstraintEntityA").setObject(line)
     constraint.data().real("ConstraintValue").setValue(length)
+    self.my.execute()
     return constraint
 
   def setRadius (self, circle, radius):
@@ -160,10 +161,10 @@ class Sketch():
     dx = geomDataAPI_Dir( self.my.data().attribute("DirX") ).dir()
     n  = geomDataAPI_Dir( self.my.data().attribute("Norm") ).dir()
 
-    self.faces = ShapeList()      # The faces are kept otherwise they are destroyed at exit
-    GeomAlgoAPI_SketchBuilder.createFaces(o, dx, n, self.selection, self.faces)
+    faces = ShapeList()      # The faces are kept otherwise they are destroyed at exit
+    GeomAlgoAPI_SketchBuilder.createFaces(o, dx, n, self.selection, faces)
 #TODO: Deal with several faces 
-    return self.faces[0]
+    return faces[0]
 
   def result (self):
     """Returns the result data of this Feature."""