Salome HOME
Fix compilation error (conflict of OK name between OCCT Plate_Plate.hxx and GEOM...
[modules/geom.git] / doc / salome / examples / complex_objs_ex05.py
index 724810c580b21871424995de86282d7b47a56957..011f791d1b4f022b5526754e71606cfb52f013c1 100644 (file)
@@ -1,7 +1,10 @@
 # Creation of a PipeWithDifferentSections
 
-import geompy
 import salome
+salome.salome_init_without_session()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New()
 gg = salome.ImportComponentGUI("GEOM")
 
 Wire_1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 100 0:R 0:C 100 90:T 0 200", [0, 0, 0, 0, 0, 1, 1, 0, -0])
@@ -15,18 +18,22 @@ circles.append(geompy.MakeCircle(vertices[1], edges[0], 40))
 circles.append(geompy.MakeCircle(vertices[2], edges[2], 30))
 circles.append(geompy.MakeCircle(vertices[3], edges[2], 20))
 
-# create pipe
-Pipe = geompy.MakePipeWithDifferentSections(circles, vertices, Wire_1, 0, 0)
+# create pipes
+Pipe1 = geompy.MakePipeWithDifferentSections(circles, vertices, Wire_1, 0, 0)
+Pipe2 = geompy.MakePipeWithDifferentSectionsBySteps(circles, vertices, Wire_1)
 
 # add objects in the study
 geompy.addToStudy(circles[0], "circles1")
 geompy.addToStudy(circles[1], "circles2")
 geompy.addToStudy(circles[2], "circles3")
 geompy.addToStudy(circles[3], "circles4")
-id_wire = geompy.addToStudy(Wire_1, "Path")
-id_pipe = geompy.addToStudy(Pipe, "Pipe")
+id_wire  = geompy.addToStudy(Wire_1, "Path")
+id_pipe1 = geompy.addToStudy(Pipe1, "Pipe1")
+id_pipe2 = geompy.addToStudy(Pipe2, "Pipe2")
 
 # display the wire(path) and the pipe
 gg.createAndDisplayGO(id_wire)
-gg.createAndDisplayGO(id_pipe)
-gg.setDisplayMode(id_pipe,1) 
+gg.createAndDisplayGO(id_pipe1)
+gg.createAndDisplayGO(id_pipe2)
+gg.setDisplayMode(id_pipe1,1)
+gg.setDisplayMode(id_pipe2,1)