+
+ #--------------------------------------------------------------------------
+
+def setCurrentStudy(theStudy):
+ """
+ Change current study : an existing one given by a study object.
+
+ :param theStudy: the study CORBA object to set as current study
+
+ Obsolete: only one study can be opened at the moment.
+ This function works properly if specified theStudy parameter
+ corresponds to the currently opened study.
+ Kept for backward compatibility only.
+ """
+ global myStudyId, myStudy, myStudyName
+ global salome_study_ID
+ myStudy = theStudy
+ myStudyId = theStudy._get_StudyId()
+ myStudyName = theStudy._get_Name()
+ return myStudyId, myStudy, myStudyName
+
+ #--------------------------------------------------------------------------
+
+# *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 setCurrentStudyId(*args):
+ """
+ Change current study : an existing or new one.
+
+ This function connects to the single opened study if there is any; otherwise
+ new empty study is created.
+
+ Obsolete: only one study can be opened at the moment.
+ Kept for backward compatibility only.
+ """
+ global myStudyManager, myStudyId, myStudy, myStudyName
+ global salome_study_ID
+ salome_study_ID = -1
+ myStudyId = getActiveStudy()
+ if not myStudyId:
+ myStudyId = createNewStudy()
+ if verbose(): print "myStudyId",myStudyId
+ myStudy = myStudyManager.GetStudyByID(myStudyId)
+ myStudyName = myStudy._get_Name()
+ return myStudyId, myStudy, myStudyName
+