class Arc(Interface):
"""Interface to a sketch arc feature."""
- def __init__(self, feature, *args):
+ def __init__(self, feature, *args, **kwargs):
Interface.__init__(self, feature)
assert(self._feature.getKind() == "SketchArc")
self._end_point = geomDataAPI_Point2D(
self._feature.data().attribute("ArcEndPoint")
)
+ self._inversed = self._feature.boolean("InversedArc")
if len(args) == 6:
self.__createByCoordinates(*args)
elif len(args) == 3:
raise WrongNumberOfArguments(
"Arc takes 3 or 6 arguments (%s given)" % len(args)
)
+ if "inversed" in kwargs:
+ self.setInversed(kwargs["inversed"])
self.execute()
-
-
+
+
########
#
# Getters
def result(self):
"""Return the arc circular line attribute."""
return self._feature.lastResult()
-
-
+
+
########
#
# Set methods
#
########
-
+
def setCenter(self, x, y):
"""Set arc center."""
self._center.setValue(x, y)
-
+
def setStartPoint(self, x, y):
"""Set start point."""
self._start_point.setValue(x, y)
-
+
def setEndPoint(self, x, y):
"""Set end point value."""
self._end_point.setValue(x, y)
+ def setInversed(self, inversed):
+ self._fillAttribute(self._inversed, inversed)
########
#
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:
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)
#-------------------------------------------------------------
#