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

This commit is contained in:
mpa 2013-11-19 11:32:06 +00:00
parent ffc352d7cc
commit c08215621d
2 changed files with 8 additions and 4 deletions

View File

@ -27,7 +27,7 @@ from salome.smesh.smeshBuilder import AssureGeomPublished, ParseParameters, IsEq
# import NETGENPlugin module if possible
noNETGENPlugin = 0
try:
import NETGENPlugin
from salome.NETGENPlugin import NETGENPluginBuilder
except ImportError:
noNETGENPlugin = 1
pass

View File

@ -1283,8 +1283,10 @@ void NETGENPlugin_Mesher::AddIntVerticesInSolids(const netgen::OCCGeometry&
#ifdef DUMP_TRIANGLES_SCRIPT
// create a python script making a mesh containing triangles added for internal vertices
ofstream py(DUMP_TRIANGLES_SCRIPT);
py << "from smesh import * "<< endl
<< "m = Mesh(name='triangles')" << endl;
py << "import SMESH"<< endl
<< "from salome.smesh import smeshBuilder"<<endl
<< "smesh = smeshBuilder.New(salome.myStudy)"
<< "m = smesh.Mesh(name='triangles')" << endl;
#endif
if ( nodeVec.size() < ngMesh.GetNP() )
nodeVec.resize( ngMesh.GetNP(), 0 );
@ -3124,7 +3126,9 @@ void NETGENPlugin_Mesher::toPython( const netgen::Mesh* ngMesh,
ofstream outfile(pyFile.c_str(), ios::out);
if ( !outfile ) return;
outfile << "import smesh, SMESH" << endl
outfile << "import SMESH" << endl
<< "from salome.smesh import smeshBuilder" << endl
<< "smesh = smeshBuilder.New(salome.myStudy)" << endl
<< "mesh = smesh.Mesh()" << endl << endl;
using namespace netgen;