# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#--------------------------------------------------------------------------
-def DumpComponent(Study, SO, offset):
- it = Study.NewChildIterator(SO)
- Builder = Study.NewBuilder()
+def DumpComponent(SO, offset):
+ global myStudy
+ it = myStudy.NewChildIterator(SO)
+ Builder = myStudy.NewBuilder()
while it.More():
CSO = it.Value()
it.Next()
while ofs <= offset:
a = a + "--"
ofs = ofs +1
- print a + ">" + CSO.GetID() + " " + t_name[1]
+ print(a + ">" + CSO.GetID() + " " + t_name[1])
t_RefSO = CSO.ReferencedObject()
if t_RefSO[0] == 1:
RefSO = t_RefSO[1]
while ofs <= offset:
a = a + " "
ofs = ofs +1
- print a + ">" + RefSO.GetID()
- DumpComponent(Study, CSO, offset+2)
+ print(a + ">" + RefSO.GetID())
+ DumpComponent(CSO, offset+2)
#--------------------------------------------------------------------------
-def DumpStudy(Study):
- itcomp = Study.NewComponentIterator()
+def DumpStudy():
+ global myStudy
+ itcomp = myStudy.NewComponentIterator()
while itcomp.More():
SC = itcomp.Value()
itcomp.Next()
name = SC.ComponentDataType()
- print "-> ComponentDataType is " + name
- DumpComponent(Study, SC, 1)
+ print("-> ComponentDataType is " + name)
+ DumpComponent(SC, 1)
#--------------------------------------------------------------------------
# get active study name
myStudyName = sg.getStudyName()
-print myStudyName
+print(myStudyName)
# get Study reference
-obj = naming_service.Resolve('Study')
+obj = naming_service.Resolve('/Study')
myStudy = obj._narrow(SALOMEDS.Study)