]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[PythonAPI] Use _fillAttribute() in some sketch functions
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 16 Dec 2015 08:39:40 +0000 (11:39 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Thu, 17 Dec 2015 11:53:07 +0000 (14:53 +0300)
src/PythonAPI/model/sketcher/sketch.py

index ae490a047b04a38b3fc7f974002dd4621bdbdbe5..0ba028e64572fd54a5b237158b9f90debfaac00a 100644 (file)
@@ -194,8 +194,8 @@ class Sketch(Interface):
         if p1 is None or p2 is None:
             raise TypeError("NoneType argument given")
         constraint = self._feature.addFeature("SketchConstraintCoincidence")
-        constraint.data().refattr("ConstraintEntityA").setAttr(p1)
-        constraint.data().refattr("ConstraintEntityB").setAttr(p2)
+        self._fillAttribute(constraint.refattr("ConstraintEntityA"), p1)
+        self._fillAttribute(constraint.refattr("ConstraintEntityB"), p2)
         self.execute()
         return constraint
 
@@ -264,7 +264,7 @@ class Sketch(Interface):
             raise TypeError("NoneType argument given")
         constraint = self._feature.addFeature("SketchConstraintLength")
         constraint.data().refattr("ConstraintEntityA").setObject(line)
-        constraint.data().real("ConstraintValue").setValue(length)
+        self._fillAttribute(constraint.real("ConstraintValue"), length)
         self.execute()
         return constraint
 
@@ -272,8 +272,8 @@ class Sketch(Interface):
         """Set the radius of the given circle and add the corresponding
         constraint to this Sketch."""
         constraint = self._feature.addFeature("SketchConstraintRadius")
-        constraint.data().refattr("ConstraintEntityA").setObject(circle)
-        constraint.data().real("ConstraintValue").setValue(radius)
+        self._fillAttribute(constraint.refattr("ConstraintEntityA"), circle)
+        self._fillAttribute(constraint.real("ConstraintValue"), radius)
         self.execute()
         return constraint
 
@@ -321,7 +321,7 @@ class Sketch(Interface):
     def setRigid(self, object_):
         """Set a rigid constraint on a given object."""
         constraint = self._feature.addFeature("SketchConstraintRigid")
-        constraint.data().refattr("ConstraintEntityA").setObject(object_)
+        self._fillAttribute(constraint.refattr("ConstraintEntityA"), object_)
         self.execute()
         return constraint