From 313bdfc1c75365ab9d5fa07ebc069e068c82fac9 Mon Sep 17 00:00:00 2001 From: dmv Date: Mon, 21 Dec 2009 14:26:43 +0000 Subject: [PATCH] 0020623: EDF 1209 SMESH: Load script/execfile add the objects in the wrong study --- src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py | 2 ++ src/SMESH_SWIG/SMESH_blocks.py | 1 + src/SMESH_SWIG/batchmode_smesh.py | 1 + src/SMESH_SWIG/ex01_cube2build.py | 2 ++ src/SMESH_SWIG/ex02_cube2primitive.py | 2 ++ src/SMESH_SWIG/ex03_cube2partition.py | 2 ++ src/SMESH_SWIG/ex04_cube5tetraHexa.py | 2 ++ src/SMESH_SWIG/ex05_hole1build.py | 2 ++ src/SMESH_SWIG/ex06_hole1boolean.py | 2 ++ src/SMESH_SWIG/ex07_hole1partition.py | 2 ++ src/SMESH_SWIG/ex08_hole2build.py | 2 ++ src/SMESH_SWIG/ex09_grid4build.py | 2 ++ src/SMESH_SWIG/ex10_grid4geometry.py | 2 ++ src/SMESH_SWIG/ex11_grid3partition.py | 2 ++ src/SMESH_SWIG/ex12_grid17partition.py | 2 ++ src/SMESH_SWIG/ex13_hole1partial.py | 2 ++ src/SMESH_SWIG/ex14_cyl1holed.py | 2 ++ src/SMESH_SWIG/ex15_cyl2geometry.py | 2 ++ src/SMESH_SWIG/ex16_cyl2complementary.py | 2 ++ src/SMESH_SWIG/ex17_dome1.py | 2 ++ src/SMESH_SWIG/ex18_dome2.py | 2 ++ src/SMESH_SWIG/ex19_sphereINcube.py | 2 ++ src/SMESH_SWIG/ex21_lamp.py | 2 ++ src/SMESH_SWIG/ex24_cylinder.py | 2 ++ src/SMESH_SWIG/ex30_groupsOp.py | 2 +- src/SMESH_SWIG/ex30_tepal.py | 2 ++ src/SMESH_SWIG/ex31_dimGroup.py | 2 +- 27 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py index 816dede85..63a04efa6 100644 --- a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py +++ b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py @@ -22,6 +22,8 @@ # import smesh +smesh.SetCurrentStudy(salome.myStudy) + def BuildGroupLyingOn(theMesh, theElemType, theName, theShape): aFilterMgr = smesh.smesh.CreateFilterManager() aFilter = aFilterMgr.CreateFilter() diff --git a/src/SMESH_SWIG/SMESH_blocks.py b/src/SMESH_SWIG/SMESH_blocks.py index d3e744d5f..fce550fb5 100644 --- a/src/SMESH_SWIG/SMESH_blocks.py +++ b/src/SMESH_SWIG/SMESH_blocks.py @@ -36,6 +36,7 @@ import GEOM_Spanner isBlocksTest = 0 # False isMeshTest = 1 # True +smesh.SetCurrentStudy(salome.myStudy) GEOM_Spanner.MakeSpanner(geompy, math, isBlocksTest, isMeshTest, smesh) diff --git a/src/SMESH_SWIG/batchmode_smesh.py b/src/SMESH_SWIG/batchmode_smesh.py index eb2c4e1fe..04091bdc6 100644 --- a/src/SMESH_SWIG/batchmode_smesh.py +++ b/src/SMESH_SWIG/batchmode_smesh.py @@ -33,6 +33,7 @@ import SMESH modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog") smesh = lcc.FindOrLoadComponent("FactoryServer", "SMESH") +smesh.SetCurrentStudy(myStudy) myStudyBuilder = myStudy.NewBuilder() if myStudyBuilder is None: diff --git a/src/SMESH_SWIG/ex01_cube2build.py b/src/SMESH_SWIG/ex01_cube2build.py index 34bb6e39d..3c1da5aab 100644 --- a/src/SMESH_SWIG/ex01_cube2build.py +++ b/src/SMESH_SWIG/ex01_cube2build.py @@ -287,6 +287,8 @@ piece_id = addToStudy(piece, "ex01_cube2build") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create hexahedrical mesh on piece # --------------------------------- diff --git a/src/SMESH_SWIG/ex02_cube2primitive.py b/src/SMESH_SWIG/ex02_cube2primitive.py index 885d8722a..277dfbc8a 100644 --- a/src/SMESH_SWIG/ex02_cube2primitive.py +++ b/src/SMESH_SWIG/ex02_cube2primitive.py @@ -98,6 +98,8 @@ piece_id = addToStudy(piece, "ex02_cube2primitive") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create hexahedrical mesh on piece # --------------------------------- diff --git a/src/SMESH_SWIG/ex03_cube2partition.py b/src/SMESH_SWIG/ex03_cube2partition.py index d620a6411..a9d1cc975 100644 --- a/src/SMESH_SWIG/ex03_cube2partition.py +++ b/src/SMESH_SWIG/ex03_cube2partition.py @@ -85,6 +85,8 @@ piece_id = addToStudy(piece, "ex03_cube2partition") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create hexahedrical mesh on piece # --------------------------------- diff --git a/src/SMESH_SWIG/ex04_cube5tetraHexa.py b/src/SMESH_SWIG/ex04_cube5tetraHexa.py index 02f6f2c87..57edb88c8 100644 --- a/src/SMESH_SWIG/ex04_cube5tetraHexa.py +++ b/src/SMESH_SWIG/ex04_cube5tetraHexa.py @@ -66,6 +66,8 @@ piece_id = addToStudy(piece, "ex04_cube5tetraHexa") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex05_hole1build.py b/src/SMESH_SWIG/ex05_hole1build.py index 31793da2e..5b3cb4ab7 100644 --- a/src/SMESH_SWIG/ex05_hole1build.py +++ b/src/SMESH_SWIG/ex05_hole1build.py @@ -124,6 +124,8 @@ piece_id = addToStudy(piece, "ex05_hole1build") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex06_hole1boolean.py b/src/SMESH_SWIG/ex06_hole1boolean.py index acdc7f5e9..ee62820fb 100644 --- a/src/SMESH_SWIG/ex06_hole1boolean.py +++ b/src/SMESH_SWIG/ex06_hole1boolean.py @@ -118,6 +118,8 @@ piece_id = addToStudy(piece, "ex06_hole1boolean") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex07_hole1partition.py b/src/SMESH_SWIG/ex07_hole1partition.py index 4ca5c481d..ab55f37ee 100644 --- a/src/SMESH_SWIG/ex07_hole1partition.py +++ b/src/SMESH_SWIG/ex07_hole1partition.py @@ -82,6 +82,8 @@ piece_id = addToStudy(piece, "ex07_hole1partition") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex08_hole2build.py b/src/SMESH_SWIG/ex08_hole2build.py index cb417562e..af46cb575 100644 --- a/src/SMESH_SWIG/ex08_hole2build.py +++ b/src/SMESH_SWIG/ex08_hole2build.py @@ -115,6 +115,8 @@ piece_id = addToStudy(piece, "ex08_hole2build") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex09_grid4build.py b/src/SMESH_SWIG/ex09_grid4build.py index 4fd9c6db2..9d51821f6 100644 --- a/src/SMESH_SWIG/ex09_grid4build.py +++ b/src/SMESH_SWIG/ex09_grid4build.py @@ -118,6 +118,8 @@ piece_id = addToStudy(piece, "ex09_grid4build") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex10_grid4geometry.py b/src/SMESH_SWIG/ex10_grid4geometry.py index f9a8c399b..2e244e7c4 100644 --- a/src/SMESH_SWIG/ex10_grid4geometry.py +++ b/src/SMESH_SWIG/ex10_grid4geometry.py @@ -80,6 +80,8 @@ piece_id = addToStudy(piece, "ex10_grid4geometry") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex11_grid3partition.py b/src/SMESH_SWIG/ex11_grid3partition.py index 1ed38c03b..71e88a7ed 100644 --- a/src/SMESH_SWIG/ex11_grid3partition.py +++ b/src/SMESH_SWIG/ex11_grid3partition.py @@ -101,6 +101,8 @@ piece_id = addToStudy(piece, "ex11_grid3partition") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex12_grid17partition.py b/src/SMESH_SWIG/ex12_grid17partition.py index 3499a3e0b..ca95b25de 100644 --- a/src/SMESH_SWIG/ex12_grid17partition.py +++ b/src/SMESH_SWIG/ex12_grid17partition.py @@ -116,6 +116,8 @@ piece_id = addToStudy(piece, "ex12_grid17partition") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex13_hole1partial.py b/src/SMESH_SWIG/ex13_hole1partial.py index 609f48052..24c12090d 100644 --- a/src/SMESH_SWIG/ex13_hole1partial.py +++ b/src/SMESH_SWIG/ex13_hole1partial.py @@ -214,6 +214,8 @@ piece_id = addToStudy(piece, "ex13_hole1partial") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a mesh # ------------- diff --git a/src/SMESH_SWIG/ex14_cyl1holed.py b/src/SMESH_SWIG/ex14_cyl1holed.py index 1c89971fc..e01d6ac1a 100644 --- a/src/SMESH_SWIG/ex14_cyl1holed.py +++ b/src/SMESH_SWIG/ex14_cyl1holed.py @@ -99,6 +99,8 @@ piece_id = addToStudy(piece, "ex14_cyl1holed") # Maillage # ======== +smesh.SetCurrentStudy(salome.myStudy) + # Creer un maillage hexahedrique # ------------------------------ diff --git a/src/SMESH_SWIG/ex15_cyl2geometry.py b/src/SMESH_SWIG/ex15_cyl2geometry.py index 72a0a4b92..418b1cb1e 100644 --- a/src/SMESH_SWIG/ex15_cyl2geometry.py +++ b/src/SMESH_SWIG/ex15_cyl2geometry.py @@ -178,6 +178,8 @@ piece_id = addToStudy(piece, "ex15_cyl2geometry") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex16_cyl2complementary.py b/src/SMESH_SWIG/ex16_cyl2complementary.py index 4a3adf337..c67af2395 100644 --- a/src/SMESH_SWIG/ex16_cyl2complementary.py +++ b/src/SMESH_SWIG/ex16_cyl2complementary.py @@ -108,6 +108,8 @@ piece_id = addToStudy(piece, "ex16_cyl2complementary") # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex17_dome1.py b/src/SMESH_SWIG/ex17_dome1.py index c94136b20..efa10ae09 100644 --- a/src/SMESH_SWIG/ex17_dome1.py +++ b/src/SMESH_SWIG/ex17_dome1.py @@ -81,6 +81,8 @@ piece_id = addToStudy(piece, "ex17_dome1") # Maillage # ======== +smesh.SetCurrentStudy(salome.myStudy) + # Maillage hexahedrique # --------------------- diff --git a/src/SMESH_SWIG/ex18_dome2.py b/src/SMESH_SWIG/ex18_dome2.py index fc78722d7..85df8ffe4 100644 --- a/src/SMESH_SWIG/ex18_dome2.py +++ b/src/SMESH_SWIG/ex18_dome2.py @@ -118,6 +118,8 @@ piece_id = addToStudy(piece, "ex18_dome2") # Maillage # ======== +smesh.SetCurrentStudy(salome.myStudy) + # Maillage hexahedrique # --------------------- diff --git a/src/SMESH_SWIG/ex19_sphereINcube.py b/src/SMESH_SWIG/ex19_sphereINcube.py index 53b6e2ae6..9aa839289 100644 --- a/src/SMESH_SWIG/ex19_sphereINcube.py +++ b/src/SMESH_SWIG/ex19_sphereINcube.py @@ -168,6 +168,8 @@ UnionList(groupe, groupe_sphere) # Meshing # ======= +smesh.SetCurrentStudy(salome.myStudy) + # Create a hexahedral mesh # ------------------------ diff --git a/src/SMESH_SWIG/ex21_lamp.py b/src/SMESH_SWIG/ex21_lamp.py index b7a511d4d..c92b77eb1 100644 --- a/src/SMESH_SWIG/ex21_lamp.py +++ b/src/SMESH_SWIG/ex21_lamp.py @@ -93,6 +93,8 @@ UnionIDs(group, faces) # Create a mesh # ============= +smesh.SetCurrentStudy(salome.myStudy) + # Define a mesh on a geometry # --------------------------- diff --git a/src/SMESH_SWIG/ex24_cylinder.py b/src/SMESH_SWIG/ex24_cylinder.py index 2e7b52d82..22f363a18 100644 --- a/src/SMESH_SWIG/ex24_cylinder.py +++ b/src/SMESH_SWIG/ex24_cylinder.py @@ -98,6 +98,8 @@ geo.DifferenceList(group_1, [group_1_box]) # Mesh the blocks with hexahedral # ------------------------------- +smesh.SetCurrentStudy(salome.myStudy) + def discretize(x, y, z, n, s=blocks): p = geo.MakeVertex(x, y, z) e = geo.GetEdgeNearPoint(s, p) diff --git a/src/SMESH_SWIG/ex30_groupsOp.py b/src/SMESH_SWIG/ex30_groupsOp.py index f1a857d9a..9842e0b97 100755 --- a/src/SMESH_SWIG/ex30_groupsOp.py +++ b/src/SMESH_SWIG/ex30_groupsOp.py @@ -16,7 +16,7 @@ global Face_1 Face_1 = geompy.MakeFaceHW(100, 100, 1) geompy.addToStudy( Face_1, "Face_1" ) -#smesh.smesh.SetCurrentStudy(aStudyId) +smesh.SetCurrentStudy(salome.myStudy) import StdMeshers pattern = smesh.GetPattern() Mesh_1 = smesh.Mesh(Face_1) diff --git a/src/SMESH_SWIG/ex30_tepal.py b/src/SMESH_SWIG/ex30_tepal.py index 61a035022..1a3d7755e 100644 --- a/src/SMESH_SWIG/ex30_tepal.py +++ b/src/SMESH_SWIG/ex30_tepal.py @@ -28,6 +28,8 @@ geompy.addToStudy(cylinder, "Cylinder") # Define a mesh on a geometry # --------------------------- +smesh.SetCurrentStudy(salome.myStudy) + m = smesh.Mesh(cylinder) # 2D mesh with BLSURF diff --git a/src/SMESH_SWIG/ex31_dimGroup.py b/src/SMESH_SWIG/ex31_dimGroup.py index 7f4600d3f..149271fc0 100755 --- a/src/SMESH_SWIG/ex31_dimGroup.py +++ b/src/SMESH_SWIG/ex31_dimGroup.py @@ -18,7 +18,7 @@ global Box_1 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) geompy.addToStudy( Box_1, "Box_1" ) -#smesh.smesh.SetCurrentStudy(theStudy) +smesh.SetCurrentStudy(salome.myStudy) import StdMeshers Mesh_1 = smesh.Mesh(Box_1) Regular_1D = Mesh_1.Segment() -- 2.39.2