Personal tools
You are here: Home Forum Use Scripting compound of all meshes

Scripting compound of all meshes

Up to Use


This forum is DEPRECATED, please create new topics in the new SALOME forum.
For existing topics please transfer them to the new forum.

Scripting compound of all meshes

Posted by bezzienri at February 02. 2022

Dear All,

is there a way to create a python script to make a compound of all the meshes in my active study?

At the moment I only managed to find the code for printing all the meshes names:

smeshComp = salome.myStudy.FindComponent("SMESH")
iterator = salome.myStudy.NewChildIterator( smeshComp )
while iterator.More():
  sobj = iterator.Value()
  iterator.Next()
  if hasattr( sobj.GetObject(), "NbNodes" ):
     print(smeshBuilder.GetName(sobj))

How can I apply this to the smesh.Concatenate command?

Compound_Mesh_1 = smesh.Concatenate( [ Mesh_1.GetMesh(), Mesh_2.GetMesh(),etc... ], 1, 1, 0.001, False )

Maybe some kind of wildcard could help...

 

Thank you in advance for any suggestions.
Best Regards,
Enrico

Re: Scripting compound of all meshes

Posted by smeap at February 02. 2022

Hi

Keep all the found meshes in a list and them pass the list as the 1st argument of smesh.Concatenate( theFoundMeshesList, ...)

St.Michael


This forum is DEPRECATED, please create new topics in the new SALOME forum.
For existing topics please transfer them to the new forum.

Powered by Ploneboard
Document Actions