mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 08:50:35 +05:00
0020623: EDF 1209 SMESH: Load script/execfile add the objects in the wrong study
set current study to SMESH_Gen
This commit is contained in:
parent
31873e6e23
commit
0c1e7c3900
@ -54,7 +54,7 @@ Id_face1 = geompy.addToStudy(face1,"Face1")
|
|||||||
|
|
||||||
|
|
||||||
#-----------------------------SMESH-------------------------------------------
|
#-----------------------------SMESH-------------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# -- Init mesh --
|
# -- Init mesh --
|
||||||
plane_mesh = salome.IDToObject( Id_face1)
|
plane_mesh = salome.IDToObject( Id_face1)
|
||||||
|
@ -52,6 +52,7 @@ id_ellipse2 = geompy.addToStudy(ellipse2, "Ellips 2")
|
|||||||
|
|
||||||
|
|
||||||
#---------------------------------SMESH
|
#---------------------------------SMESH
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# create the path mesh
|
# create the path mesh
|
||||||
mesh1 = smesh.Mesh(ellipse1, "Path Mesh")
|
mesh1 = smesh.Mesh(ellipse1, "Path Mesh")
|
||||||
|
@ -50,6 +50,7 @@ idcircle = geompy.addToStudy(circle, "Circle")
|
|||||||
idface = geompy.addToStudy(face, "Circular face")
|
idface = geompy.addToStudy(face, "Circular face")
|
||||||
|
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# init a Mesh with the circular face
|
# init a Mesh with the circular face
|
||||||
mesh1 = smesh.Mesh(face, "Mesh on circular face")
|
mesh1 = smesh.Mesh(face, "Mesh on circular face")
|
||||||
|
@ -51,6 +51,7 @@ def GetNewNodes(mesh,Elems,OldNodes):
|
|||||||
pass
|
pass
|
||||||
return newnodes
|
return newnodes
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# create empty mesh
|
# create empty mesh
|
||||||
mesh = smesh.Mesh()
|
mesh = smesh.Mesh()
|
||||||
|
@ -61,6 +61,8 @@ geompy.addToStudy(Box_sup, "Box_sup")
|
|||||||
geompy.addToStudyInFather(Box_sup, Fsup2, "Fsup")
|
geompy.addToStudyInFather(Box_sup, Fsup2, "Fsup")
|
||||||
geompy.addToStudyInFather(Box_sup, Finf2, "Finf")
|
geompy.addToStudyInFather(Box_sup, Finf2, "Finf")
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
## create a bottom mesh
|
## create a bottom mesh
|
||||||
Mesh_inf = smesh.Mesh(Box_inf, "Mesh_inf")
|
Mesh_inf = smesh.Mesh(Box_inf, "Mesh_inf")
|
||||||
algo1D_1=Mesh_inf.Segment()
|
algo1D_1=Mesh_inf.Segment()
|
||||||
|
@ -97,6 +97,8 @@ Cut_1_ID = geompy.addToStudy(Cut_1, "Cut_1")
|
|||||||
|
|
||||||
#Mesh creation
|
#Mesh creation
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# -- Init --
|
# -- Init --
|
||||||
shape_mesh = salome.IDToObject( Cut_1_ID )
|
shape_mesh = salome.IDToObject( Cut_1_ID )
|
||||||
|
|
||||||
|
@ -119,6 +119,7 @@ status = geompy.CheckShape(alveole)
|
|||||||
print " check status ", status
|
print " check status ", status
|
||||||
|
|
||||||
# ---- launch SMESH
|
# ---- launch SMESH
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- init a Mesh with the alveole
|
# ---- init a Mesh with the alveole
|
||||||
shape_mesh = salome.IDToObject( idalveole )
|
shape_mesh = salome.IDToObject( idalveole )
|
||||||
|
@ -103,6 +103,7 @@ Id_Result = addToStudy(Result, "Result")
|
|||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
#Meshing
|
#Meshing
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
my_hexa = smesh.Mesh(Result, "Sphere_Mesh")
|
my_hexa = smesh.Mesh(Result, "Sphere_Mesh")
|
||||||
algo = my_hexa.Segment()
|
algo = my_hexa.Segment()
|
||||||
algo.NumberOfSegments(NbSeg)
|
algo.NumberOfSegments(NbSeg)
|
||||||
|
@ -47,6 +47,7 @@ box = geompy.MakeBox(0.,0.,0.,1.,1.,1.)
|
|||||||
boxId = geompy.addToStudy(box,"box")
|
boxId = geompy.addToStudy(box,"box")
|
||||||
|
|
||||||
# ---- SMESH
|
# ---- SMESH
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- init a Mesh
|
# ---- init a Mesh
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ print "number of Edges in shell : ", len(subEdgeList)
|
|||||||
|
|
||||||
|
|
||||||
### ---------------------------- SMESH --------------------------------------
|
### ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- init a Mesh with the shell
|
# ---- init a Mesh with the shell
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ print "number of Edges in shell : ", len(subEdgeList)
|
|||||||
|
|
||||||
|
|
||||||
### ---------------------------- SMESH --------------------------------------
|
### ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- init a Mesh with the shell
|
# ---- init a Mesh with the shell
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ print "number of Edges in box : ", len(subEdgeList)
|
|||||||
|
|
||||||
|
|
||||||
### ---------------------------- SMESH --------------------------------------
|
### ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- init a Mesh with the boxe
|
# ---- init a Mesh with the boxe
|
||||||
|
|
||||||
|
@ -124,6 +124,7 @@ for i in range(8):
|
|||||||
idEdgeZ.append(geompy.addToStudyInFather(vol,edgeZ[i],"EdgeZ"+str(i+1)))
|
idEdgeZ.append(geompy.addToStudyInFather(vol,edgeZ[i],"EdgeZ"+str(i+1)))
|
||||||
|
|
||||||
### ---------------------------- SMESH --------------------------------------
|
### ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- init a Mesh with the volume
|
# ---- init a Mesh with the volume
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ status = geompy.CheckShape(compshell)
|
|||||||
print " check status ", status
|
print " check status ", status
|
||||||
|
|
||||||
### ---------------------------- SMESH --------------------------------------
|
### ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- init a Mesh with the compshell
|
# ---- init a Mesh with the compshell
|
||||||
shape_mesh = salome.IDToObject( idcomp )
|
shape_mesh = salome.IDToObject( idcomp )
|
||||||
|
@ -45,6 +45,7 @@ status = geompy.CheckShape(compshell)
|
|||||||
print " check status ", status
|
print " check status ", status
|
||||||
|
|
||||||
### ---------------------------- SMESH --------------------------------------
|
### ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
print "-------------------------- create Mesh, algorithm, hypothesis"
|
print "-------------------------- create Mesh, algorithm, hypothesis"
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ status = geompy.CheckShape(compshell)
|
|||||||
print " check status ", status
|
print " check status ", status
|
||||||
|
|
||||||
### ---------------------------- SMESH --------------------------------------
|
### ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- init a Mesh with the compshell
|
# ---- init a Mesh with the compshell
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ print "number of Edges in flight : ", len(subEdgeList)
|
|||||||
|
|
||||||
|
|
||||||
### ---------------------------- SMESH --------------------------------------
|
### ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- init a Mesh with the shell
|
# ---- init a Mesh with the shell
|
||||||
shape_mesh = salome.IDToObject( idShape )
|
shape_mesh = salome.IDToObject( idShape )
|
||||||
|
@ -41,6 +41,7 @@ idbox = geompy.addToStudy( aBox, "box" )
|
|||||||
aBox = salome.IDToObject( idbox )
|
aBox = salome.IDToObject( idbox )
|
||||||
|
|
||||||
# Create mesh
|
# Create mesh
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
mesh = smesh.Mesh(aBox, "Mesh_freebord")
|
mesh = smesh.Mesh(aBox, "Mesh_freebord")
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ salome.sg.updateObjBrowser(1)
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
print "-------------------------- mesh"
|
print "-------------------------- mesh"
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- init a Mesh with the geom shape
|
# ---- init a Mesh with the geom shape
|
||||||
shape_mesh = blob
|
shape_mesh = blob
|
||||||
|
@ -120,6 +120,7 @@ name = geompy.SubShapeName( sub_face4, mechanic )
|
|||||||
Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
|
Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
|
||||||
|
|
||||||
# ---------------------------- SMESH --------------------------------------
|
# ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# -- Init --
|
# -- Init --
|
||||||
shape_mesh = salome.IDToObject( Id_mechanic )
|
shape_mesh = salome.IDToObject( Id_mechanic )
|
||||||
|
@ -118,6 +118,7 @@ name = geompy.SubShapeName( sub_face4, mechanic )
|
|||||||
Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
|
Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
|
||||||
|
|
||||||
# ---------------------------- SMESH --------------------------------------
|
# ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# -- Init --
|
# -- Init --
|
||||||
shape_mesh = salome.IDToObject( Id_mechanic )
|
shape_mesh = salome.IDToObject( Id_mechanic )
|
||||||
|
@ -104,6 +104,7 @@ print "number of Faces in mechanic : ",len(subFaceList)
|
|||||||
print "number of Edges in mechanic : ",len(subEdgeList)
|
print "number of Edges in mechanic : ",len(subEdgeList)
|
||||||
|
|
||||||
### ---------------------------- SMESH --------------------------------------
|
### ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
print "-------------------------- create Mesh, algorithm, hypothesis"
|
print "-------------------------- create Mesh, algorithm, hypothesis"
|
||||||
|
|
||||||
|
@ -104,6 +104,7 @@ print "number of Faces in mechanic : ",len(subFaceList)
|
|||||||
print "number of Edges in mechanic : ",len(subEdgeList)
|
print "number of Edges in mechanic : ",len(subEdgeList)
|
||||||
|
|
||||||
### ---------------------------- SMESH --------------------------------------
|
### ---------------------------- SMESH --------------------------------------
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
shape_mesh = salome.IDToObject( Id_mechanic )
|
shape_mesh = salome.IDToObject( Id_mechanic )
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ salome.sg.updateObjBrowser(1);
|
|||||||
# ---- launch SMESH
|
# ---- launch SMESH
|
||||||
smeshgui = salome.ImportComponentGUI("SMESH")
|
smeshgui = salome.ImportComponentGUI("SMESH")
|
||||||
smeshgui.Init(salome.myStudyId)
|
smeshgui.Init(salome.myStudyId)
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- Creating meshes
|
# ---- Creating meshes
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ ide = geompy.addToStudyInFather(face, edge, name)
|
|||||||
|
|
||||||
# ---- SMESH
|
# ---- SMESH
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
box = salome.IDToObject(idb)
|
box = salome.IDToObject(idb)
|
||||||
mesh = smesh.Mesh(box, "Meshbox")
|
mesh = smesh.Mesh(box, "Meshbox")
|
||||||
|
|
||||||
|
@ -60,6 +60,8 @@ idedge = geompy.addToStudyInFather(face, edge, name)
|
|||||||
|
|
||||||
# ---- SMESH
|
# ---- SMESH
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- Init a Mesh with the box
|
# ---- Init a Mesh with the box
|
||||||
|
|
||||||
mesh = smesh.Mesh(box, "Meshbox")
|
mesh = smesh.Mesh(box, "Meshbox")
|
||||||
|
@ -60,6 +60,8 @@ idedge = geompy.addToStudyInFather(face, edge, name)
|
|||||||
|
|
||||||
# ---- SMESH
|
# ---- SMESH
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# ---- Init a Mesh with the box
|
# ---- Init a Mesh with the box
|
||||||
|
|
||||||
mesh = smesh.Mesh(box, "Meshbox")
|
mesh = smesh.Mesh(box, "Meshbox")
|
||||||
|
@ -40,6 +40,7 @@ face = salome.IDToObject(idface)
|
|||||||
|
|
||||||
# ---- SMESH
|
# ---- SMESH
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
mesh = smesh.Mesh(box, "Meshbox")
|
mesh = smesh.Mesh(box, "Meshbox")
|
||||||
|
|
||||||
# Set 1D algorithm/hypotheses to mesh
|
# Set 1D algorithm/hypotheses to mesh
|
||||||
|
@ -30,6 +30,8 @@ import CORBA
|
|||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
def SetSObjName(theSObj,theName) :
|
def SetSObjName(theSObj,theName) :
|
||||||
ok, anAttr = theSObj.FindAttribute("AttributeName")
|
ok, anAttr = theSObj.FindAttribute("AttributeName")
|
||||||
if ok:
|
if ok:
|
||||||
|
Loading…
Reference in New Issue
Block a user