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

View File

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

View File

@ -34,7 +34,7 @@ import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
import StdMeshers
from salome.StdMeshers import StdMeshersBuilder
# ---- 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 Mesh
import StdMeshers
from salome.StdMeshers import StdMeshersBuilder
#----------------------------
# Mesh algo type identifiers

View File

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

View File

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

View File

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