]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
- Modifing Geometry and Mesh Python scripts from SALOME 6 and before
authormpa <mpa@opencascade.com>
Tue, 19 Nov 2013 12:41:57 +0000 (12:41 +0000)
committermpa <mpa@opencascade.com>
Tue, 19 Nov 2013 12:41:57 +0000 (12:41 +0000)
doc/salome/examples/filters_ex35.py
src/StdMeshers/StdMeshers_ViscousLayers.cxx
src/Tools/padder/resources/testdata/buildparticules.py
src/Tools/padder/spadderpy/gui/plugindialog.py

index 4a3c2bd3c303441e63bcd9372870ddb568b3c594..99c5ef546ec69a5458701f51543e5e250f335adc 100644 (file)
@@ -5,10 +5,10 @@ from SMESH_mechanic import *
 mesh.Tetrahedron()
 mesh.Compute()
 # get all triangles, quadrangles, tetrahedrons, pyramids
-filter_tri = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, smesh.Geom_TRIANGLE)
-filter_qua = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, smesh.Geom_QUADRANGLE)
-filter_tet = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, smesh.Geom_TETRA)
-filter_pyr = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, smesh.Geom_PYRAMID)
+filter_tri = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, SMESH.Geom_TRIANGLE)
+filter_qua = smesh.GetFilter(SMESH.FACE, SMESH.FT_ElemGeomType, SMESH.Geom_QUADRANGLE)
+filter_tet = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, SMESH.Geom_TETRA)
+filter_pyr = smesh.GetFilter(SMESH.VOLUME, SMESH.FT_ElemGeomType, SMESH.Geom_PYRAMID)
 ids_tri = mesh.GetIdsFromFilter(filter_tri)
 ids_qua = mesh.GetIdsFromFilter(filter_qua)
 ids_tet = mesh.GetIdsFromFilter(filter_tet)
index 9a9a5387b5fc3745e78571bfa37dde1a3bbae173..6a6d871c43d65d25128c00a3f466aa903662e998 100644 (file)
@@ -865,9 +865,11 @@ namespace
       const char* fname = "/tmp/viscous.py";
       cout << "execfile('"<<fname<<"')"<<endl;
       py = new ofstream(fname);
-      *py << "from smesh import *" << endl
-          << "meshSO = GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
-          << "mesh = Mesh( meshSO.GetObject() )"<<endl;
+      *py << "import SMESH" << endl
+          << "from salome.smesh import smeshBuilder" << endl
+          << "smesh = smeshBuilder.New(salome.myStudy)" << endl
+          << "meshSO = smesh.GetCurrentStudy().FindObjectID('0:1:2:3')" << endl
+          << "mesh = smesh.Mesh( meshSO.GetObject() )"<<endl;
     }
     void Finish() {
       if (py)
index 0777160b7233c68c433b79cccc296473c7c2d3fd..b8d40dc029947c23d454fe78d50e6d2ece022a68 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-import geompy
 import salome
 salome.salome_init()
-theStudy = salome.myStudy
-geompy.init_geom(theStudy)
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
 
 filename="/home/gboulant/development/projets/salome/SPADDER/spadder/resources/padderexe/REF_spheres.dat.xyz"
 file=open(filename,'rb')
index 87666f579cf072fd39a74297c64e2561bd9fbf36..ab6869288a0edcfea3f88603839d865deadb8204 100644 (file)
@@ -37,7 +37,8 @@ from salome.kernel.uiexception import AdminException
 
 from omniORB import CORBA
 import SMESH
-import smesh
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
 import MESHJOB
 
 gui_states = ["CAN_SELECT", "CAN_COMPUTE", "CAN_REFRESH", "CAN_PUBLISH"]