-salome_study_ID = -1
-
-# *args are used here to support backward compatibility
-# previously it was possible to pass theStudyId parameter to this function
-# which is no more supported.
-def getActiveStudy(*args):
- global myStudyManager
- global salome_study_ID
-
- if not myStudyManager:
- print("No active study")
- return None
- pass
-
- if verbose(): print("getActiveStudy")
- if salome_study_ID == -1:
- listOpenStudies = myStudyManager.GetOpenStudies()
- if len(listOpenStudies) == 0:
- return None
- else:
- s = myStudyManager.GetStudyByName(listOpenStudies[0])
- salome_study_ID = s._get_StudyId()
- 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())