The UpdateStudyCase function can be used in a number of ways:
Use this function to update an attribute on a single Study Case. It will update the specified attribute of the first Study Case it encounters (the one with the lowest Run Order value) with the specified Run ID.
ADS.UpdateStudyCase(runId As String, attribute As Options.StudyCase, newValue As Object) As Boolean
Capitalization does not matter for the given runId. The function will return True if the update completed successfully or False otherwise. The possible attributes it can update are:
Options.StudyCase.RunId: newValue must be a String.
Options.StudyCase.RMTName: newValue must be a String.
Options.StudyCase.ParameterSet: newValue must be a String. Capitalization does matter and any leading or trailing spaces in Parameter Set Name will be trimmed. If the given Parameter Set Name does not exist, the parameter set name will change to be empty.
Options.StudyCase.ChangeSets: newValue must be a String. This will remove any Change Sets already in the Study Case and replace them with the Change Sets in the given comma delimited list. Capitalization does not matter and any leading or trailing spaces in the Change Set names will be trimmed. If one of the Change Set names given is not contained in Change Sets, none of the Change Set updates will go through. To delete all Change Sets from a Study Case, have the newValue be an empty String, “”.
Options.StudyCase.BaseCase: newValue must be a Boolean. Only one Study Case can be a base case. If a Study Case is set to be a base case, all other study cases will be set to not be the base case.
Options.StudyCase.RunCase: newValue must be a Boolean. Selects a Study Case to be run as part of a simulation.
Options.StudyCase.RunOrder: newValue must be an Integer. The run order of the Study Cases. If two Study Cases are given the same Run Case value, ie) 0, then the order of the Study Cases will be based alphabetically.
Dim result = ADS.UpdateStudyCase(“New Case”, StudyCase.RunCase, True)
Dim result = ADS.UpdateStudyCase(“New Case 1”, StudyCase.ChangeSets, “New Change Set 1, New Change Set 3”)
This has the same functionality of ADS.UpdateStudyCase, however you can set multiple attributes for different Study Cases at once. Also, this is faster than calling ADS.UpdateStudyCase multiple times because the changes will only be pushed to the UI once at the end, not after every update.
ADS.UpdateStudyCases(runIds() As String, attributes() As Options.StudyCase, newValues() As Object) As Boolean()
The function will return an array of Booleans, True if the attribute was updated successfully or False otherwise. For example:
Dim RunIds(3) As String
Dim AttNames(3) As StudyCase
Dim NewValues(3) As Object
RunIds(0) = "New Case 2"
AttNames(0) = StudyCase.RunId
NewValues(0) = "New Case 1"
RunIds(1) = "New Case 1"
AttNames(1) = StudyCase.BaseCase
NewValues(1) = True
RunIds(2) = "New Case 6"
AttNames(2) = StudyCase.ParameterSet
NewValues(2) = "Parameter Set 1"
RunIds(3) = "New Case 5"
AttNames(3) = StudyCase.RunOrder
NewValues(3) = 2
Dim Results = ADS.UpdateStudyCases(RunIds, AttNames, NewValues)
This function will create and add a Study Case.
ADS.AddNewStudyCase(runId As String, Optional runCase As Boolean = True, Optional baseCase As Boolean = False, Optional runOrder As Integer = 0, Optional rmtName As String = "", Optional parameterSetName As String = "", Optional changeSets As String = "") As Boolean
The only mandatory parameter is the Run ID. Unless specified otherwise, the defaults for the optional parameters will be used. To skip defining a parameter, just use ‘, ,’ in the parameters, i.e. ADS.AddNewStudyCase(“New Case”, , True) will set New Case to be the Base Case. The default for runCase will be used, which is True. The user only needs to specially skip over parameters if they are before the one they want to change from the default. If they are after, a closing parenthesis can be used and those parameters will still use the default. The default for RunOrder is 0, so it will appear at the top of the Study Case List unless otherwise specified. To make sure the new Study Case appears at the bottom of the run order, set the value to the count of the study cases, or a large number like 1000. The function will return True if the Study Case was added successfully or False otherwise.
Dim result = ADS.AddNewStudyCase(“New Study Case”)
Dim result = ADS.AddNewStudyCase(“New Study Case”, False, False, 10, “New RMT Name”, “Parameter Set 2”, “New Change Set 1, New Change Set 2”)
Dim result = ADS.AddNewStudyCase(“New Study Case”, , , , “New RMT Name”)
Dim result = ADS.AddNewStudyCase(“New Study Case”, , , , , , “New Change Set 1, New Change Set 2”)
This will delete the Study Case with the specified Run ID.
ADS.DeleteStudyCase(runId As String) As Boolean
If there are multiple Study Cases with that Run ID, it will delete the first one it encounters, the one with the lowest Run Order. The function will return True if the Study Case was deleted successfully or False otherwise.
Dim result = ADS.DeleteStudyCase(“Study Case 1”)
This will add a Change Set to the Study Case with the specified Run ID. Unlike ADS.UpdateStudyCase/s, this will only add the Change Set, it will not remove any existing Change Sets in the Study Case.
ADS.AddChangeSetToStudyCase(runId As String, changeSetName As String) As Boolean
Only specify one Change Set to add, it will not accept a comma delimited list. Capitalization does not matter and any leading or trailing spaces in the Change Set names will be trimmed. The function will return True if the Change Set was added successfully or False otherwise.
Dim result = ADS.AddChangeSetToStudyCase(“New Case”, “New Change Set 3”)
This will remove a Change Set from a Study Case with the specified Run ID. This will only remove the specified Change Set, it will not affect any other existing Change Sets in the Study Case.
ADS.RemoveChangeSetFromStudyCase(runId As String, changeSetName As String) As Boolean
Only specify one Change Set to remove from the Study Case, it will not accept a comma delimited list. Capitalization does not matter and any leading or trailing spaces in the Change Set names will be trimmed. The function will return True if the Change Set was removed from the Study Case successfully or False otherwise.
Dim result = ADS.RemoveChangeSetFromStudyCase(“New Case”, “New Change Set 1”)
For further assistance, please contact Aurora Support.
Copyright© 1997-2024 Energy Exemplar LLC. All rights reserved.