- Modifing Geometry and Mesh Python scripts from SALOME 6 and before

This commit is contained in:
mpa 2013-11-19 12:41:57 +00:00
parent 98eacab61c
commit e2a638a026
4 changed files with 14 additions and 11 deletions

View 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)

View 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)

View File

@ -18,11 +18,11 @@
# 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')

View 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"]