From 233e7998338d82ef9443bba5a4072e0b52d49d3c Mon Sep 17 00:00:00 2001 From: spo Date: Wed, 16 Dec 2015 11:36:53 +0300 Subject: [PATCH] [PythonAPI] Add Entity class for sketch entity and make Line as an inheritant of Entity --- src/PythonAPI/model/sketcher/entity.py | 15 +++++++++++++++ src/PythonAPI/model/sketcher/line.py | 6 ++++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/PythonAPI/model/sketcher/entity.py diff --git a/src/PythonAPI/model/sketcher/entity.py b/src/PythonAPI/model/sketcher/entity.py new file mode 100644 index 000000000..b2cea8803 --- /dev/null +++ b/src/PythonAPI/model/sketcher/entity.py @@ -0,0 +1,15 @@ + +from model.roots import Interface + +class Entity(Interface): + """Interface for editing of a sketch entity feature.""" + + def __init__(self, feature): + Interface.__init__(self, feature) + + # Initialize attributes + self._auxiliary = self._feature.boolean("Auxiliary") + + def setAuxiliary(self, a): + """Set the Auxiliarity.""" + self._auxiliary.setValue(a) diff --git a/src/PythonAPI/model/sketcher/line.py b/src/PythonAPI/model/sketcher/line.py index e4111e070..93f354ba0 100644 --- a/src/PythonAPI/model/sketcher/line.py +++ b/src/PythonAPI/model/sketcher/line.py @@ -2,10 +2,12 @@ from GeomDataAPI import geomDataAPI_Point2D from model.roots import Interface from model.errors import WrongNumberOfArguments -class Line(Interface): +from .entity import Entity + +class Line(Entity): """Interface for editing of a sketch line feature.""" def __init__(self, feature, *args): - Interface.__init__(self, feature) + Entity.__init__(self, feature) assert(self._feature.getKind() == "SketchLine") # Initialize attributes -- 2.39.2