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

This commit is contained in:
mpa 2013-11-19 12:03:24 +00:00
parent a08c213e66
commit 47bdf12d63
7 changed files with 19 additions and 13 deletions

View File

@ -97,8 +97,10 @@ class SMeshStudyTools:
''' '''
if entry is None: if entry is None:
return None return None
import smesh import SMESH
smesh.SetCurrentStudy(self.editor.study) from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(self.editor.study)
meshObject=smesh.IDToObject(entry) meshObject=smesh.IDToObject(entry)
return meshObject return meshObject
@ -153,13 +155,17 @@ class SMeshStudyTools:
def TEST_createBoxMesh(): def TEST_createBoxMesh():
theStudy = helper.getActiveStudy() theStudy = helper.getActiveStudy()
import geompy import GEOM
geompy.init_geom(theStudy) from salome.geom import geomBuilder
geompy = geomBuilder.New(theStudy)
box = geompy.MakeBoxDXDYDZ(200, 200, 200) box = geompy.MakeBoxDXDYDZ(200, 200, 200)
import smesh, SMESH, SALOMEDS import SMESH, SALOMEDS
smesh.SetCurrentStudy(theStudy) from salome.smesh import smeshBuilder
import StdMeshers smesh = smeshBuilder.New(theStudy)
from salome.StdMeshers import StdMeshersBuilder
boxmesh = smesh.Mesh(box) boxmesh = smesh.Mesh(box)
Regular_1D = boxmesh.Segment() Regular_1D = boxmesh.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(15) Nb_Segments_1 = Regular_1D.NumberOfSegments(15)

View File

@ -37,7 +37,7 @@ import SMESH, SALOMEDS
from salome.smesh import smeshBuilder from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy) smesh = smeshBuilder.New(salome.myStudy)
import StdMeshers from salome.StdMeshers import StdMeshersBuilder
# ---------------------------- GEOM -------------------------------------- # ---------------------------- GEOM --------------------------------------

View File

@ -34,7 +34,7 @@ import SMESH, SALOMEDS
from salome.smesh import smeshBuilder from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy) smesh = smeshBuilder.New(salome.myStudy)
import StdMeshers from salome.StdMeshers import StdMeshersBuilder
# ---- define a box # ---- define a box

View File

@ -26,7 +26,7 @@ from salome.smesh.smeshBuilder import AssureGeomPublished, IsEqual, ParseParamet
from salome.smesh.smeshBuilder import GetName, TreatHypoStatus from salome.smesh.smeshBuilder import GetName, TreatHypoStatus
from salome.smesh.smeshBuilder import Mesh from salome.smesh.smeshBuilder import Mesh
import StdMeshers from salome.StdMeshers import StdMeshersBuilder
#---------------------------- #----------------------------
# Mesh algo type identifiers # Mesh algo type identifiers

View File

@ -27,7 +27,7 @@ import re
import batchmode_salome import batchmode_salome
import batchmode_geompy import batchmode_geompy
import batchmode_smesh import batchmode_smesh
import StdMeshers from salome.StdMeshers import StdMeshersBuilder
smesh = batchmode_smesh.smesh smesh = batchmode_smesh.smesh
smesh.SetCurrentStudy(batchmode_salome.myStudy) smesh.SetCurrentStudy(batchmode_salome.myStudy)

View File

@ -34,7 +34,7 @@ Face_1 = geompy.MakeFaceHW(100, 100, 1)
geompy.addToStudy( Face_1, "Face_1" ) geompy.addToStudy( Face_1, "Face_1" )
smesh.SetCurrentStudy(salome.myStudy) smesh.SetCurrentStudy(salome.myStudy)
import StdMeshers from salome.StdMeshers import StdMeshersBuilder
pattern = smesh.GetPattern() pattern = smesh.GetPattern()
Mesh_1 = smesh.Mesh(Face_1) Mesh_1 = smesh.Mesh(Face_1)
Regular_1D = Mesh_1.Segment() Regular_1D = Mesh_1.Segment()

View File

@ -34,7 +34,7 @@ Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
geompy.addToStudy( Box_1, "Box_1" ) geompy.addToStudy( Box_1, "Box_1" )
smesh.SetCurrentStudy(salome.myStudy) smesh.SetCurrentStudy(salome.myStudy)
import StdMeshers from salome.StdMeshers import StdMeshersBuilder
Mesh_1 = smesh.Mesh(Box_1) Mesh_1 = smesh.Mesh(Box_1)
Regular_1D = Mesh_1.Segment() Regular_1D = Mesh_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(10) Nb_Segments_1 = Regular_1D.NumberOfSegments(10)