-salome_study_ID = -1
-
-def getActiveStudy():
- global salome_study_ID
-
- if verbose(): print "getActiveStudy"
- if salome_study_ID == -1:
- if salome_iapp.hasDesktop():
- if verbose(): print "---in gui"
- salome_study_ID = salome_iapp.sg.getActiveStudyId()
- else:
- if verbose(): print "---outside gui"
- if salome_study_ID == -1:
- listOpenStudies = myStudyManager.GetOpenStudies()
- if len(listOpenStudies) == 0:
- salome_study_ID = createNewStudy()
- else:
- s = myStudyManager.GetStudyByName(listOpenStudies[0])
- salome_study_ID = s._get_StudyId()
- else:
- pass
- #if theStudyId:
- #aStudy=myStudyManager.GetStudyByID(theStudyId)
- #if aStudy:
- #if verbose(): print "connection to existing study ", theStudyId
- #salome_study_ID = theStudyId
- if verbose(): print"--- Study Id ", salome_study_ID
- return salome_study_ID
+def openStudy(theStudyPath):
+ if verbose(): print("openStudy (begin)")
+ global myStudy, myStudyName
+ myStudy.Open(theStudyPath)
+ myStudyName = myStudy._get_Name()
+ if verbose(): print("openStudy (end):", theStudyPath, myStudy._get_Name())