ChangeParametersMultipleElement Function
The ChangeParametersMultipleElement function allows you to set parameters for multiple objects of the same type in a case loaded into the Simulator Automation Server. This function is very similar to the ChangeParametersSingleElement, but allows for modifying multiple elements with a single function call. The advantage of this function is that it is much faster to change multiple elements with a single function call than it is to repeatedly call ChangeParametersSingleElement multiple times.
Unlike the script SetData and CreateData commands, SimAuto does not have any explicit functions to create elements. Instead this can be done using the ChangeParameters functions by making use of the CreateIfNotFound SimAuto property. Set CreateIfNotFound = True if objects that are updated through the ChangeParameters functions should be created if they do not already exist in the case. Objects that already exist will be updated. Set CreateIfNotFound = False to not create new objects and only update existing ones. The CreateIfNotFound property is global, once it is set to True this applies to all future ChangeParameters calls.
Function Prototype
ChangeParametersMultipleElement(ObjectType, ParamList, Values)
Parameter Definitions
ObjectType : String The type of object for which parameters are being changed.
ParamList : Variant A variant array storing strings (COM Type BSTR). This array stores a list of PowerWorldâ object field variables, as defined in the section on PowerWorld Object Fields. The ParamList must contain the key field variables for the specific device, or the device cannot be identified.
ValueList : Variant A variant array storing arrays of variants. This is the difference between the multiple element and single element change parameter functions. This array stores a list of arrays of values matching the fields laid out in ParamList. You construct ValueList by creating an array of variants with the necessary parameters for each device, and then inserting each individual array of values into the ValueList array. SimAuto will pick out each array from ValueList, and calls ChangeParametersSingleElement internally for each array of values in ValueList.
Output
ChangeParametersMultipleElement only returns the first element in Output, the error string.
Notes
The ParameterList and each array of values stored in ValueList must be the same size, as each parameter must have a corresponding value to be assigned.