mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-24 16:30:34 +05:00
0020623: EDF 1209 SMESH: Load script/execfile add the objects in the wrong study
This commit is contained in:
parent
0c1e7c3900
commit
313bdfc1c7
@ -22,6 +22,8 @@
|
|||||||
#
|
#
|
||||||
import smesh
|
import smesh
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
def BuildGroupLyingOn(theMesh, theElemType, theName, theShape):
|
def BuildGroupLyingOn(theMesh, theElemType, theName, theShape):
|
||||||
aFilterMgr = smesh.smesh.CreateFilterManager()
|
aFilterMgr = smesh.smesh.CreateFilterManager()
|
||||||
aFilter = aFilterMgr.CreateFilter()
|
aFilter = aFilterMgr.CreateFilter()
|
||||||
|
@ -36,6 +36,7 @@ import GEOM_Spanner
|
|||||||
isBlocksTest = 0 # False
|
isBlocksTest = 0 # False
|
||||||
isMeshTest = 1 # True
|
isMeshTest = 1 # True
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
GEOM_Spanner.MakeSpanner(geompy, math, isBlocksTest, isMeshTest, smesh)
|
GEOM_Spanner.MakeSpanner(geompy, math, isBlocksTest, isMeshTest, smesh)
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ import SMESH
|
|||||||
modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog")
|
modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog")
|
||||||
|
|
||||||
smesh = lcc.FindOrLoadComponent("FactoryServer", "SMESH")
|
smesh = lcc.FindOrLoadComponent("FactoryServer", "SMESH")
|
||||||
|
smesh.SetCurrentStudy(myStudy)
|
||||||
myStudyBuilder = myStudy.NewBuilder()
|
myStudyBuilder = myStudy.NewBuilder()
|
||||||
|
|
||||||
if myStudyBuilder is None:
|
if myStudyBuilder is None:
|
||||||
|
@ -287,6 +287,8 @@ piece_id = addToStudy(piece, "ex01_cube2build")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create hexahedrical mesh on piece
|
# Create hexahedrical mesh on piece
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
|
|
||||||
|
@ -98,6 +98,8 @@ piece_id = addToStudy(piece, "ex02_cube2primitive")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create hexahedrical mesh on piece
|
# Create hexahedrical mesh on piece
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
|
|
||||||
|
@ -85,6 +85,8 @@ piece_id = addToStudy(piece, "ex03_cube2partition")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create hexahedrical mesh on piece
|
# Create hexahedrical mesh on piece
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
|
|
||||||
|
@ -66,6 +66,8 @@ piece_id = addToStudy(piece, "ex04_cube5tetraHexa")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -124,6 +124,8 @@ piece_id = addToStudy(piece, "ex05_hole1build")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -118,6 +118,8 @@ piece_id = addToStudy(piece, "ex06_hole1boolean")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -82,6 +82,8 @@ piece_id = addToStudy(piece, "ex07_hole1partition")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -115,6 +115,8 @@ piece_id = addToStudy(piece, "ex08_hole2build")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -118,6 +118,8 @@ piece_id = addToStudy(piece, "ex09_grid4build")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -80,6 +80,8 @@ piece_id = addToStudy(piece, "ex10_grid4geometry")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -101,6 +101,8 @@ piece_id = addToStudy(piece, "ex11_grid3partition")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -116,6 +116,8 @@ piece_id = addToStudy(piece, "ex12_grid17partition")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -214,6 +214,8 @@ piece_id = addToStudy(piece, "ex13_hole1partial")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a mesh
|
# Create a mesh
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
|
@ -99,6 +99,8 @@ piece_id = addToStudy(piece, "ex14_cyl1holed")
|
|||||||
# Maillage
|
# Maillage
|
||||||
# ========
|
# ========
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Creer un maillage hexahedrique
|
# Creer un maillage hexahedrique
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
|
|
||||||
|
@ -178,6 +178,8 @@ piece_id = addToStudy(piece, "ex15_cyl2geometry")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -108,6 +108,8 @@ piece_id = addToStudy(piece, "ex16_cyl2complementary")
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -81,6 +81,8 @@ piece_id = addToStudy(piece, "ex17_dome1")
|
|||||||
# Maillage
|
# Maillage
|
||||||
# ========
|
# ========
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Maillage hexahedrique
|
# Maillage hexahedrique
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
|
||||||
|
@ -118,6 +118,8 @@ piece_id = addToStudy(piece, "ex18_dome2")
|
|||||||
# Maillage
|
# Maillage
|
||||||
# ========
|
# ========
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Maillage hexahedrique
|
# Maillage hexahedrique
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
|
||||||
|
@ -168,6 +168,8 @@ UnionList(groupe, groupe_sphere)
|
|||||||
# Meshing
|
# Meshing
|
||||||
# =======
|
# =======
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Create a hexahedral mesh
|
# Create a hexahedral mesh
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
|
@ -93,6 +93,8 @@ UnionIDs(group, faces)
|
|||||||
# Create a mesh
|
# Create a mesh
|
||||||
# =============
|
# =============
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
# Define a mesh on a geometry
|
# Define a mesh on a geometry
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
|
|
||||||
|
@ -98,6 +98,8 @@ geo.DifferenceList(group_1, [group_1_box])
|
|||||||
# Mesh the blocks with hexahedral
|
# Mesh the blocks with hexahedral
|
||||||
# -------------------------------
|
# -------------------------------
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
def discretize(x, y, z, n, s=blocks):
|
def discretize(x, y, z, n, s=blocks):
|
||||||
p = geo.MakeVertex(x, y, z)
|
p = geo.MakeVertex(x, y, z)
|
||||||
e = geo.GetEdgeNearPoint(s, p)
|
e = geo.GetEdgeNearPoint(s, p)
|
||||||
|
@ -16,7 +16,7 @@ global Face_1
|
|||||||
Face_1 = geompy.MakeFaceHW(100, 100, 1)
|
Face_1 = geompy.MakeFaceHW(100, 100, 1)
|
||||||
geompy.addToStudy( Face_1, "Face_1" )
|
geompy.addToStudy( Face_1, "Face_1" )
|
||||||
|
|
||||||
#smesh.smesh.SetCurrentStudy(aStudyId)
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
import StdMeshers
|
import StdMeshers
|
||||||
pattern = smesh.GetPattern()
|
pattern = smesh.GetPattern()
|
||||||
Mesh_1 = smesh.Mesh(Face_1)
|
Mesh_1 = smesh.Mesh(Face_1)
|
||||||
|
@ -28,6 +28,8 @@ geompy.addToStudy(cylinder, "Cylinder")
|
|||||||
# Define a mesh on a geometry
|
# Define a mesh on a geometry
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
|
|
||||||
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
|
|
||||||
m = smesh.Mesh(cylinder)
|
m = smesh.Mesh(cylinder)
|
||||||
|
|
||||||
# 2D mesh with BLSURF
|
# 2D mesh with BLSURF
|
||||||
|
@ -18,7 +18,7 @@ global Box_1
|
|||||||
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||||
geompy.addToStudy( Box_1, "Box_1" )
|
geompy.addToStudy( Box_1, "Box_1" )
|
||||||
|
|
||||||
#smesh.smesh.SetCurrentStudy(theStudy)
|
smesh.SetCurrentStudy(salome.myStudy)
|
||||||
import StdMeshers
|
import StdMeshers
|
||||||
Mesh_1 = smesh.Mesh(Box_1)
|
Mesh_1 = smesh.Mesh(Box_1)
|
||||||
Regular_1D = Mesh_1.Segment()
|
Regular_1D = Mesh_1.Segment()
|
||||||
|
Loading…
Reference in New Issue
Block a user