From 71a74e7993bcab222f1bf8deed1d141cab81bdf5 Mon Sep 17 00:00:00 2001 From: spo Date: Wed, 16 Dec 2015 11:39:40 +0300 Subject: [PATCH] [PythonAPI] Use _fillAttribute() in some sketch functions --- src/PythonAPI/model/sketcher/sketch.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/PythonAPI/model/sketcher/sketch.py b/src/PythonAPI/model/sketcher/sketch.py index ae490a047..0ba028e64 100644 --- a/src/PythonAPI/model/sketcher/sketch.py +++ b/src/PythonAPI/model/sketcher/sketch.py @@ -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 -- 2.39.2