X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPythonAPI%2Fexamples%2FPlatine.py;h=a3e32d5e2f59b2ad7dfaeb26f500c2ebe93f176d;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=800ce0e05fbec009dcfc5543ffc70186ca71dc30;hpb=d0f078983d5f74d45a6f28b3a4dfe8feadb2cdf7;p=modules%2Fshaper.git diff --git a/src/PythonAPI/examples/Platine.py b/src/PythonAPI/examples/Platine.py index 800ce0e05..a3e32d5e2 100644 --- a/src/PythonAPI/examples/Platine.py +++ b/src/PythonAPI/examples/Platine.py @@ -1,22 +1,21 @@ -## Copyright (C) 2014-2017 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 -## +# 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 Platine model using the end-user API # Author: Sergey POKHODENKO @@ -78,7 +77,7 @@ def vertical_body(): def bottom_body(): # Create XOY sketch - sketch = model.addSketch(part, "Extrusion_1_1/Generated_Face_5") + sketch = model.addSketch(part, "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4") # Create base polygon points = [(0, 0), (0, L), (P, L), (P, 16 + 16), (P - 20, 16 + 16), (P - 20, 16), (P, 16), (P, 0)] @@ -111,7 +110,7 @@ def bottom_body(): sketch.setCoincident(arc.endPoint(), h1.startPoint()) # Binding - left_e = sketch.addLine("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1_1") + left_e = sketch.addLine("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]") sketch.setCoincident(left_e.startPoint(), left.endPoint()) sketch.setCoincident(left_e.endPoint(), left.startPoint()) @@ -132,7 +131,7 @@ def bottom_body(): def body_3(): # Create XOZ sketch - sketch = model.addSketch(part, "Boolean_1_1/Modified_3") + sketch = model.addSketch(part, "Boolean_1_1/Modified_Face&Sketch_1/SketchLine_3") # Create base polygon H, L, l, r = 28, 40, 8, 12 @@ -170,7 +169,7 @@ def body_3(): sketch.setRadius(arc, r) # Binding - bottom_e = sketch.addLine("Boolean_1_1/Modified_8&Boolean_1_1/Modified_5") + bottom_e = sketch.addLine("[Boolean_1_1/Modified_Face&Sketch_2/SketchLine_6][Extrusion_2_1/To_Face]") sketch.setCoincident(bottom_e, bottom.startPoint()) sketch.setCoincident(bottom_e.startPoint(), bottom.endPoint()) @@ -183,7 +182,7 @@ def body_3(): def body_4(): # Create XOZ 2nd sketch - sketch = model.addSketch(part, "Boolean_2_1/Modified_4") + sketch = model.addSketch(part, "Boolean_2_1/Modified_Face&Sketch_2/SketchLine_6") # Create base polygon points = [(0, 0), (0, 1), (1, 0)] @@ -192,11 +191,11 @@ def body_4(): left, diagonal, bottom = model.addPolygon(sketch, *geom_points) # Binding - bottom_e = sketch.addLine("Boolean_2_1/Modified_3&Boolean_2_1/Modified_4") + bottom_e = sketch.addLine("[Boolean_2_1/Modified_Face&Extrusion_2_1/To_Face][Boolean_2_1/Modified_Face&Sketch_2/SketchLine_6]") sketch.setCoincident(bottom_e.endPoint(), bottom.startPoint()) sketch.setCoincident(bottom_e.startPoint(), left.startPoint()) - left_e = sketch.addLine("Boolean_2_1/Modified_6&Boolean_2_1/Modified_7") + left_e = sketch.addLine("[Boolean_2_1/Modified_Face&Extrusion_3_1/From_Face][Extrusion_3_1/Generated_Face&Sketch_3/SketchLine_18]") sketch.setCoincident(left_e.startPoint(), left.endPoint()) model.do() #!!!