From: eap Date: Wed, 14 Nov 2012 13:32:35 +0000 (+0000) Subject: in GetCriterion(), publish a not published threshold shape instead of X-Git-Tag: V6_6_0rc1~50 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3ac36b919fdfb8557b80256e9e3cd3fb6db92a9f;p=modules%2Fsmesh.git in GetCriterion(), publish a not published threshold shape instead of throwing an exception --- diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index babe168b0..6167e6c9c 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -640,9 +640,13 @@ class smeshDC(SMESH._objref_SMESH_Gen): # Checks that Threshold is GEOM object if isinstance(aThreshold, geompyDC.GEOM._objref_GEOM_Object): aCriterion.ThresholdStr = GetName(aThreshold) - aCriterion.ThresholdID = aThreshold.GetStudyEntry() + aCriterion.ThresholdID = aThreshold.GetStudyEntry() if not aCriterion.ThresholdID: - raise RuntimeError, "Threshold shape must be published" + name = aCriterion.ThresholdStr + if not name: + name = "%s_%s"%(aThreshold.GetShapeType(), id(aThreshold)%10000) + aCriterion.ThresholdID = self.geompyD.addToStudy( aThreshold, name ) + #raise RuntimeError, "Threshold shape must be published" else: print "Error: The Threshold should be a shape." return None