]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[PythonAPI] Add setExternal() to line feature.
authorspo <sergey.pokhodenko@opencascade.com>
Thu, 17 Dec 2015 11:04:27 +0000 (14:04 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Thu, 17 Dec 2015 11:53:08 +0000 (14:53 +0300)
src/PythonAPI/model/sketcher/line.py

index 93f354ba063a45c76f4e7ba7ed71e747d725e5c6..215eeba809b5f6777c39e839b834e23a61326a86 100644 (file)
@@ -17,6 +17,7 @@ class Line(Entity):
         self._end_point = geomDataAPI_Point2D(
             self._feature.data().attribute("EndPoint")
             )
+        self._external = self._feature.selection("External")
 
         # If no arguments are given the attributes of the feature
         # are'nt initialized
@@ -45,7 +46,7 @@ class Line(Entity):
         self.setEndPoint(p2.x(), p2.y())
 
     def __createByName(self, name):
-        self._feature.data().selection("External").selectSubShape("EDGE", name)
+        self.setExternal(name)
 
     #######
     #
@@ -69,5 +70,9 @@ class Line(Entity):
     def endPointData(self):
         return self._end_point
 
+    def setExternal(self, name):
+        """Set external edge"""
+        self._external.selectSubShape("EDGE", name)
+
     def result(self):
         return self._feature.firstResult()