Salome HOME
updated copyright message
[modules/shaper.git] / src / PythonAPI / examples / MakeBrick1.py
index 5ef2f3c459fe26a2f0071d94dbfa91a04b4ec834..682a5d513ebca374e57b908275731060fbd08eb8 100644 (file)
@@ -1,8 +1,27 @@
+# Copyright (C) 2014-2023  CEA, EDF
+#
+# 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
+#
+
 # Creation of a box using the end-user API
 # Author: Daniel Brunier-Coulin
 # -----------------------------
 
-import model
+from salome.shaper import model
 
 
 # Initialisation
@@ -49,9 +68,9 @@ model.do()
 
 # Creating a cylinder on a face of the box
 
-thisface = "Extrusion_1_1/Generated_Face_2"
-thisxmax = "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2"
-thiszmax = "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1"
+thisface = "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"
+thisxmax = "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1]"
+thiszmax = "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]"
 
 mystand = model.addSketch(mypart, thisface)
 
@@ -69,7 +88,7 @@ model.do()
 
 # Subtracting the cylinder to the box
 
-model.addCut(mypart, mybox.result(), myboss.result())
+model.addCut(mypart, mybox.results(), myboss.results())
 model.end()