return object
- #-------------------------------------
- def giveMeshGroups( self,entry):
- #-------------------------------------
+ #----------------------------------------------
+ def giveMeshGroups( self,entry,label1,typeMesh):
+ #----------------------------------------------
msg=None
names=[]
import SMESH
# on ajoute deja le maillage
name=mailSO.GetName()
names.append(name)
+ print name
# on ajoute deja le maillage
subIt = self.editor.study.NewChildIterator(mailSO)
subSO = subIt.Value()
subIt.Next()
- if (subSO.GetName()[0:9]!="SubMeshes") : continue
+ if (subSO.GetName()[0:9]!=label1) : continue
subSSMeshit=self.editor.study.NewChildIterator(subSO)
while subSSMeshit.More():
subSSMeshSO = subSSMeshit.Value()
subSSMeshit.Next()
- if subSSMeshSO.GetObject()._narrow(SMESH.SMESH_subMesh):
+ if subSSMeshSO.GetObject()._narrow(typeMesh):
names.append(subSSMeshSO.GetName())
else :
msg=entry + " n est pas un maillage"
#---------------------------------------
def ChercheGrpMeshInSalome(self):
print "je passe par la"
+ import SMESH
+ names, msg = [], ''
+ try :
+ entries = salome.sg.getAllSelected()
+ nbEntries = len( entries )
+ names, msg = None, "Selection SALOME non autorisee."
+ if nbEntries == 1:
+ for entry in entries:
+ print entry
+ names,msg=self.giveMeshGroups(entry,"SubMeshes",SMESH.SMESH_subMesh)
+ print names
+ except :
+ print "bim bam boum"
+ return(msg,names)
+
+ #---------------------------------------
+ def ChercheGrpMailleInSalome(self):
+ import SMESH
names, msg = [], ''
#try :
- if 1 :
+ if 1:
entries = salome.sg.getAllSelected()
nbEntries = len( entries )
names, msg = None, "Selection SALOME non autorisee."
if nbEntries == 1:
for entry in entries:
print entry
- names,msg=self.giveMeshGroups(entry)
+ names,msg=self.giveMeshGroups(entry,"Groups of",SMESH.SMESH_GroupBase)
print names
#except :
- else :
+ else:
print "bim bam boum"
return(msg,names)
+
#---------------------------------------
# def buildCabriGeom( self, name, **param ):