mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-11 16:19:16 +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.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# -- Init mesh --
|
||||
plane_mesh = salome.IDToObject( Id_face1)
|
||||
|
@ -52,6 +52,7 @@ id_ellipse2 = geompy.addToStudy(ellipse2, "Ellips 2")
|
||||
|
||||
|
||||
#---------------------------------SMESH
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# create the path mesh
|
||||
mesh1 = smesh.Mesh(ellipse1, "Path Mesh")
|
||||
|
@ -50,6 +50,7 @@ idcircle = geompy.addToStudy(circle, "Circle")
|
||||
idface = geompy.addToStudy(face, "Circular face")
|
||||
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# init a Mesh with the circular face
|
||||
mesh1 = smesh.Mesh(face, "Mesh on circular face")
|
||||
|
@ -51,7 +51,8 @@ def GetNewNodes(mesh,Elems,OldNodes):
|
||||
pass
|
||||
return newnodes
|
||||
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# create empty mesh
|
||||
mesh = smesh.Mesh()
|
||||
|
||||
|
@ -61,6 +61,8 @@ geompy.addToStudy(Box_sup, "Box_sup")
|
||||
geompy.addToStudyInFather(Box_sup, Fsup2, "Fsup")
|
||||
geompy.addToStudyInFather(Box_sup, Finf2, "Finf")
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
## create a bottom mesh
|
||||
Mesh_inf = smesh.Mesh(Box_inf, "Mesh_inf")
|
||||
algo1D_1=Mesh_inf.Segment()
|
||||
|
@ -97,6 +97,8 @@ Cut_1_ID = geompy.addToStudy(Cut_1, "Cut_1")
|
||||
|
||||
#Mesh creation
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# -- Init --
|
||||
shape_mesh = salome.IDToObject( Cut_1_ID )
|
||||
|
||||
|
@ -119,6 +119,7 @@ status = geompy.CheckShape(alveole)
|
||||
print " check status ", status
|
||||
|
||||
# ---- launch SMESH
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- init a Mesh with the alveole
|
||||
shape_mesh = salome.IDToObject( idalveole )
|
||||
|
@ -103,6 +103,7 @@ Id_Result = addToStudy(Result, "Result")
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
#Meshing
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
my_hexa = smesh.Mesh(Result, "Sphere_Mesh")
|
||||
algo = my_hexa.Segment()
|
||||
algo.NumberOfSegments(NbSeg)
|
||||
|
@ -47,6 +47,7 @@ box = geompy.MakeBox(0.,0.,0.,1.,1.,1.)
|
||||
boxId = geompy.addToStudy(box,"box")
|
||||
|
||||
# ---- SMESH
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- init a Mesh
|
||||
|
||||
|
@ -73,6 +73,7 @@ print "number of Edges in shell : ", len(subEdgeList)
|
||||
|
||||
|
||||
### ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- init a Mesh with the shell
|
||||
|
||||
|
@ -84,7 +84,7 @@ print "number of Edges in shell : ", len(subEdgeList)
|
||||
|
||||
|
||||
### ---------------------------- SMESH --------------------------------------
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- init a Mesh with the shell
|
||||
|
||||
|
@ -45,6 +45,7 @@ print "number of Edges in box : ", len(subEdgeList)
|
||||
|
||||
|
||||
### ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- 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)))
|
||||
|
||||
### ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- init a Mesh with the volume
|
||||
|
||||
|
@ -45,6 +45,7 @@ status = geompy.CheckShape(compshell)
|
||||
print " check status ", status
|
||||
|
||||
### ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- init a Mesh with the compshell
|
||||
shape_mesh = salome.IDToObject( idcomp )
|
||||
|
@ -45,6 +45,7 @@ status = geompy.CheckShape(compshell)
|
||||
print " check status ", status
|
||||
|
||||
### ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
print "-------------------------- create Mesh, algorithm, hypothesis"
|
||||
|
||||
|
@ -45,6 +45,7 @@ status = geompy.CheckShape(compshell)
|
||||
print " check status ", status
|
||||
|
||||
### ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- init a Mesh with the compshell
|
||||
|
||||
|
@ -55,6 +55,7 @@ print "number of Edges in flight : ", len(subEdgeList)
|
||||
|
||||
|
||||
### ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- init a Mesh with the shell
|
||||
shape_mesh = salome.IDToObject( idShape )
|
||||
|
@ -41,6 +41,7 @@ idbox = geompy.addToStudy( aBox, "box" )
|
||||
aBox = salome.IDToObject( idbox )
|
||||
|
||||
# Create mesh
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
mesh = smesh.Mesh(aBox, "Mesh_freebord")
|
||||
|
||||
|
@ -95,6 +95,7 @@ salome.sg.updateObjBrowser(1)
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
print "-------------------------- mesh"
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- init a Mesh with the geom shape
|
||||
shape_mesh = blob
|
||||
|
@ -120,6 +120,7 @@ name = geompy.SubShapeName( sub_face4, mechanic )
|
||||
Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
|
||||
|
||||
# ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# -- Init --
|
||||
shape_mesh = salome.IDToObject( Id_mechanic )
|
||||
|
@ -118,6 +118,7 @@ name = geompy.SubShapeName( sub_face4, mechanic )
|
||||
Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
|
||||
|
||||
# ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# -- Init --
|
||||
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)
|
||||
|
||||
### ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
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)
|
||||
|
||||
### ---------------------------- SMESH --------------------------------------
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
shape_mesh = salome.IDToObject( Id_mechanic )
|
||||
|
||||
|
@ -58,7 +58,7 @@ salome.sg.updateObjBrowser(1);
|
||||
# ---- launch SMESH
|
||||
smeshgui = salome.ImportComponentGUI("SMESH")
|
||||
smeshgui.Init(salome.myStudyId)
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- Creating meshes
|
||||
|
||||
|
@ -56,6 +56,7 @@ ide = geompy.addToStudyInFather(face, edge, name)
|
||||
|
||||
# ---- SMESH
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
box = salome.IDToObject(idb)
|
||||
mesh = smesh.Mesh(box, "Meshbox")
|
||||
|
||||
|
@ -60,6 +60,8 @@ idedge = geompy.addToStudyInFather(face, edge, name)
|
||||
|
||||
# ---- SMESH
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- Init a Mesh with the box
|
||||
|
||||
mesh = smesh.Mesh(box, "Meshbox")
|
||||
|
@ -60,6 +60,8 @@ idedge = geompy.addToStudyInFather(face, edge, name)
|
||||
|
||||
# ---- SMESH
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
# ---- Init a Mesh with the box
|
||||
|
||||
mesh = smesh.Mesh(box, "Meshbox")
|
||||
|
@ -40,6 +40,7 @@ face = salome.IDToObject(idface)
|
||||
|
||||
# ---- SMESH
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
mesh = smesh.Mesh(box, "Meshbox")
|
||||
|
||||
# Set 1D algorithm/hypotheses to mesh
|
||||
|
@ -30,6 +30,8 @@ import CORBA
|
||||
import os
|
||||
import os.path
|
||||
|
||||
smesh.SetCurrentStudy(salome.myStudy)
|
||||
|
||||
def SetSObjName(theSObj,theName) :
|
||||
ok, anAttr = theSObj.FindAttribute("AttributeName")
|
||||
if ok:
|
||||
|
Loading…
Reference in New Issue
Block a user