import StdMeshers
import SALOME
+import SALOMEDS
# import NETGENPlugin module if possible
noNETGENPlugin = 0
## Gets object name
def GetName(obj):
+ if isinstance(obj, SALOMEDS._objref_SObject):
+ return obj.GetName()
ior = salome.orb.object_to_string(obj)
- sobj = salome.myStudy.FindObjectIOR(ior)
- if sobj is None:
- return NO_NAME
- else:
- attr = sobj.FindAttribute("AttributeName")[1]
- return attr.Value()
+ studies = salome.myStudyManager.GetOpenStudies()
+ for sname in studies:
+ s = salome.myStudyManager.GetStudyByName(sname)
+ if not s: continue
+ sobj = s.FindObjectIOR(ior)
+ if not sobj: continue
+ return sobj.GetName()
+ raise RuntimeError, "Null or invalid object"
## Prints error message if a hypothesis was not assigned.
def TreatHypoStatus(status, hypName, geomName, isAlgo):