UpdateStudyCase

The UpdateStudyCase function can be used in a number of ways:

 

Update Attribute on One Study Case

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:

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”)

 

Update Multiple Attributes on Different Study Cases

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)

 

Create and Add a Study Case

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”)

 

Delete a Study Case

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”)

 

Add a Change Set to a Study Case

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”)

 

Remove a Change Set to a Study Case

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.