# @param UseExisting if ==true - searches for the existing hypothesis created with
# the same parameters, else (default) - creates a new one
def SourceFaces(self, groups, toCopyMesh=False, toCopyGroups=False, UseExisting=False):
+ import SMESH
compFun = lambda hyp, args: ( hyp.GetSourceFaces() == args[0] and \
hyp.GetCopySourceMesh() == args[1], args[2] )
hyp = self.Hypothesis("ImportSource2D", [groups, toCopyMesh, toCopyGroups],
UseExisting=UseExisting, CompareMethod=compFun, toAdd=False)
+ if groups and isinstance( groups, SMESH._objref_SMESH_GroupBase ):
+ groups = [groups]
hyp.SetSourceFaces(groups)
hyp.SetCopySourceMesh(toCopyMesh, toCopyGroups)
self.mesh.AddHypothesis(hyp, self.geom)