Salome HOME
Unit tests:
[modules/shaper.git] / src / PythonAPI / model / sketcher / sketch.py
index 9a5c3c78460c73e0babce35307f4b9381bb81b08..5303f7df5c335e67554367d39c8ebc4241666953 100644 (file)
@@ -19,9 +19,9 @@ Example of code:
    >>> plane = model.defaultPlane("XOY")
    >>> sketch = model.addSketch(part, plane)
    >>> line = sketch.addLine(0, 0, 0, 1)
-   >>> line.endPointData().x()
+   >>> line.endPoint().x()
    0.0
-   >>> line.endPointData().y()
+   >>> line.endPoint().y()
    1.0
 """
 
@@ -152,7 +152,7 @@ class Sketch(Interface):
         circle_feature = self._feature.addFeature("SketchCircle")
         return Circle(circle_feature, *args)
 
-    def addArc(self, *args):
+    def addArc(self, *args, **kwargs):
         """Add an arc of circle to the sketch and return an arc object.
 
         Two different syntaxes are allowed:
@@ -176,7 +176,7 @@ class Sketch(Interface):
         if not args:
             raise TypeError("No arguments given")
         arc_feature = self._feature.addFeature("SketchArc")
-        return Arc(arc_feature, *args)
+        return Arc(arc_feature, *args, **kwargs)
 
     #-------------------------------------------------------------
     #
@@ -320,7 +320,7 @@ class Sketch(Interface):
             constraint.data().reflist("ConstraintEntityB").append(line_2)
         elif len(args) == 2:
             point, radius = args
-            self._fillAttribute(constraint.refattr("ConstraintEntityA"), point)
+            self._fillAttribute(constraint.data().refattrlist("ConstraintEntityA"), [point])
             self._fillAttribute(constraint.real("ConstraintValue"), radius)
         self.execute()
         return constraint
@@ -381,7 +381,7 @@ class Sketch(Interface):
         # Adding and connecting next lines
         for c2 in coords[2:]:
             line_2 = self.addLine(c1, c2)
-            self.setCoincident(line_1.endPointData(), line_2.startPointData())
+            self.setCoincident(line_1.endPoint(), line_2.startPoint())
             polyline.append(line_2)
             c1 = c2
             line_1 = line_2
@@ -398,10 +398,10 @@ class Sketch(Interface):
         cn = coords[len(coords) - 1]
         ln = self.addLine(cn, c0)
         self.setCoincident(
-            pg[len(coords) - 2].endPointData(), ln.startPointData()
+            pg[len(coords) - 2].endPoint(), ln.startPoint()
             )
         self.setCoincident(
-            ln.endPointData(), pg[0].startPointData()
+            ln.endPoint(), pg[0].startPoint()
             )
         pg.append(ln)
         return pg