From 0dd01869796db20e66017a92a4760cc0c6c2b03d Mon Sep 17 00:00:00 2001 From: spo Date: Wed, 16 Dec 2015 11:40:35 +0300 Subject: [PATCH] [PythonAPI] Fix fillet constraint to match the new interface --- src/PythonAPI/model/sketcher/sketch.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 -- 2.39.2