From: spo Date: Wed, 16 Dec 2015 08:40:35 +0000 (+0300) Subject: [PythonAPI] Fix fillet constraint to match the new interface X-Git-Tag: V_2.1.0~162^2~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0dd01869796db20e66017a92a4760cc0c6c2b03d;p=modules%2Fshaper.git [PythonAPI] Fix fillet constraint to match the new interface --- diff --git a/src/PythonAPI/model/sketcher/sketch.py b/src/PythonAPI/model/sketcher/sketch.py index 0ba028e64..9a5c3c784 100644 --- a/src/PythonAPI/model/sketcher/sketch.py +++ b/src/PythonAPI/model/sketcher/sketch.py @@ -308,13 +308,20 @@ class Sketch(Interface): self.execute() return constraint - def setFillet(self, line_1, line_2, radius): + def setFillet(self, *args): """Set a fillet constraint between the 2 given lines with the given filleting radius.""" + assert(args) constraint = self._feature.addFeature("SketchConstraintFillet") - constraint.data().refattr("ConstraintEntityA").setObject(line_1) - constraint.data().reflist("ConstraintEntityB").clear() - constraint.data().reflist("ConstraintEntityB").append(line_2) + if len(args) == 3: + line_1, line_2, radius = args + constraint.data().refattr("ConstraintEntityA").setObject(line_1) + constraint.data().reflist("ConstraintEntityB").clear() + constraint.data().reflist("ConstraintEntityB").append(line_2) + elif len(args) == 2: + point, radius = args + self._fillAttribute(constraint.refattr("ConstraintEntityA"), point) + self._fillAttribute(constraint.real("ConstraintValue"), radius) self.execute() return constraint