mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-31 10:09:53 +05:00
Issue 0020701: EDF SMESH : GetName Method of smeshDC.py
This commit is contained in:
parent
2d2603289a
commit
8321c7460e
@ -99,6 +99,7 @@ from SMESH import *
|
|||||||
import StdMeshers
|
import StdMeshers
|
||||||
|
|
||||||
import SALOME
|
import SALOME
|
||||||
|
import SALOMEDS
|
||||||
|
|
||||||
# import NETGENPlugin module if possible
|
# import NETGENPlugin module if possible
|
||||||
noNETGENPlugin = 0
|
noNETGENPlugin = 0
|
||||||
@ -393,13 +394,17 @@ NO_NAME = "NoName"
|
|||||||
|
|
||||||
## Gets object name
|
## Gets object name
|
||||||
def GetName(obj):
|
def GetName(obj):
|
||||||
|
if isinstance(obj, SALOMEDS._objref_SObject):
|
||||||
|
return obj.GetName()
|
||||||
ior = salome.orb.object_to_string(obj)
|
ior = salome.orb.object_to_string(obj)
|
||||||
sobj = salome.myStudy.FindObjectIOR(ior)
|
studies = salome.myStudyManager.GetOpenStudies()
|
||||||
if sobj is None:
|
for sname in studies:
|
||||||
return NO_NAME
|
s = salome.myStudyManager.GetStudyByName(sname)
|
||||||
else:
|
if not s: continue
|
||||||
attr = sobj.FindAttribute("AttributeName")[1]
|
sobj = s.FindObjectIOR(ior)
|
||||||
return attr.Value()
|
if not sobj: continue
|
||||||
|
return sobj.GetName()
|
||||||
|
raise RuntimeError, "Null or invalid object"
|
||||||
|
|
||||||
## Prints error message if a hypothesis was not assigned.
|
## Prints error message if a hypothesis was not assigned.
|
||||||
def TreatHypoStatus(status, hypName, geomName, isAlgo):
|
def TreatHypoStatus(status, hypName, geomName, isAlgo):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user