Salome HOME
Update copyrights
[modules/shaper.git] / src / PythonAddons / macros / box / feature.py
index 18f4b24f6223444fa28cb66f78c4772ed64c7296..c669ec09e5b75a6ed474e0a83da7d9dda678f28c 100644 (file)
@@ -1,10 +1,29 @@
-"""Box macro-feature
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+"""
+Box macro-feature
 Authors: Renaud Nedelec - Daniel Brunier-Coulin
-Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 """
 
-import model
-import geom
+from salome.shaper import model
+from salome.shaper import geom
 
 
 class BoxFeature(model.Feature):
@@ -82,7 +101,8 @@ class BoxFeature(model.Feature):
         self.base.setPerpendicular(line[0], line[3])
 
         # execute sketch
-        model.do()
+        mypart.setCurrentFeature(self.base.feature(), False)
+        model.updateFeatures()
 
         # Creating the extrusion (the box) at default size
         # A box result