Personal tools
You are here: Home Forum How to use Salome? TUI to switch from GEOM module to MESH

TUI to switch from GEOM module to MESH

Up to How to use Salome?

TUI to switch from GEOM module to MESH

Posted by JMB at July 01. 2010

Hello,

I have written two scripts.  One to create the geometry I need (geom.py) and a second one (mesh.py) to mesh it.  The reason I have two separate script files is because I run the geom.py in the GEOM module (via GUI interface), then manually switch over to the MESH module and run the (mesh.py) meshing script.

What I would like to do is have one script file that does the geometry construction, then switches over to the MESH module and runs the meshing, (subsequently the application of boundary conditions and loads) and of course finally generating an output file ready for a solver.

If I append the mesh.py to the end of the geom.py and run it as one script only the geometry creation part works, none of the meshing code works.  What I am missing the "switch over" code.  Can somebody tell me what I need to do please?  Thank you.

I tried something like:

[code]

...

Mesh_1.Compute()

from salome import ImportComponentGUI
 gg = ImportComponentGUI("SMESH")
# gg.CreateAndDisplayActor(the_entry)
gg.CreateAndDisplayActor(Mesh_1)

[/code]

But that did not work :(

 

Regards,

JMB

 

Re: TUI to switch from GEOM module to MESH

Posted by JMB at July 01. 2010

Disregard my message, I figured out my problem

JMB

Re: TUI to switch from GEOM module to MESH

Posted by TIAN Chao at December 31. 2010

Previously JMB wrote:

Disregard my message, I figured out my problem

JMB

Hi, JMB
Could you Tell us how you fix the problem? Thanks a million in advance.

Tian

Re: TUI to switch from GEOM module to MESH

Posted by JMB at December 31. 2010

Hello TIAN Chao,

Something like:

myVisu = visu_gui.myVisu
myVisu.SetCurrentStudy(salome.myStudy)
myViewManager = myVisu.GetViewManager()
myView = myViewManager.Create3DView()         # Use this only if a VTK view is not available
# myView = myViewManager.GetCurrentView()     # Use this only if a VTK view is available
myView.SetView((VISU.View3D.TOP))

... might work for you.  Although you may have to click on the icon that selects the MESH module then click on the actual mesh to see it.  If you can figure that out, let me(us) know.  Regards, JMB

Powered by Ploneboard
Document Actions