1 #==============================================================================
3 # Created : mer oct 17 08:42:01 CEST 2001
4 # Author : Paul RASCLE, EDF
8 #==============================================================================
11 from omniORB import CORBA
12 from LifeCycleCORBA import *
13 from libSALOME_Swig import *
15 from SALOME_NamingServicePy import *
17 #--------------------------------------------------------------------------
19 def DumpComponent(Study, SO, offset):
20 it = Study.NewChildIterator(SO)
21 Builder = Study.NewBuilder()
25 anAttr = Builder.FindOrCreateAttribute(CSO, "AttributeName")
26 AtName = anAttr._narrow(SALOMEDS.AttributeName)
27 t_name = AtName.Value()
34 print a + ">" + CSO.GetID() + " " + t_name[1]
35 t_RefSO = CSO.ReferencedObject()
43 print a + ">" + RefSO.GetID()
44 DumpComponent(Study, CSO, offset+2)
46 #--------------------------------------------------------------------------
49 itcomp = Study.NewComponentIterator()
53 name = SC.ComponentDataType()
54 print "-> ComponentDataType is " + name
55 DumpComponent(Study, SC, 1)
58 #--------------------------------------------------------------------------
61 orb = CORBA.ORB_init([''], CORBA.ORB_ID)
63 # create an LifeCycleCORBA instance
64 lcc = LifeCycleCORBA(orb)
66 # create an SALOMEGUI_Swig instance
69 #create an naming service instance
70 naming_service = SALOME_NamingServicePy_i(orb)
72 # get active study name and id
73 myStudyName = sg.getActiveStudyName()
76 myStudyId = sg.getActiveStudyId()
79 # get Study Manager reference
80 obj = naming_service.Resolve('myStudyManager')
81 myStudyManager = obj._narrow(SALOMEDS.StudyManager)
84 myStudy = myStudyManager.GetStudyByName(myStudyName)