From: spo Date: Wed, 16 Dec 2015 08:36:53 +0000 (+0300) Subject: [PythonAPI] Add Entity class for sketch entity and make Line as an inheritant of... X-Git-Tag: V_2.1.0~162^2~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=233e7998338d82ef9443bba5a4072e0b52d49d3c;p=modules%2Fshaper.git [PythonAPI] Add Entity class for sketch entity and make Line as an inheritant of Entity --- 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