WriteAuxFile Function
The WriteAuxFile function can be used to write data from the case in the Simulator Automation Server to a PowerWorldâ Auxiliary file. The function is flexible in that you can specify the type of object data you want to export, an advanced filter name for a filter you want to use, and as many or as few field types as desired that are supported by the type of object. In addition, you can specify a new file name for each call to WriteAuxFile, or you can specify the same file name and append the data to the file.
Function Prototype
WriteAuxFile(FileName, FilterName, ObjectType, ToAppend, FieldList)
Parameter Definitions
FileName : String The name of the PowerWorldâ Auxiliary file you wish to save.
FilterName : String The name of an advanced filter which was previously defined in the case before being loaded in the Simulator Automation Server. If no filter is desired, then simply pass an empty string. If a filter name is passed but the filter cannot be found in the loaded case, no filter is used.
ObjectType : String A string describing the type of object for which your are requesting data.
ToAppend : Boolean If you have given a file name of an auxiliary file that already exists, the file will either be appended to or overwritten according to the setting of this parameter. False means to overwrite an existing file and True means to append to an existing file.
FieldList : Variant This parameter must either be an array of fields for the given object or the string "ALL". As an array, FieldList contains an array of strings, where each string represents an object field variable, as defined in the section on PowerWorld Object Variables. If, instead of an array of strings, the single string "ALL" is passed, all fields for the objecttype will be included when exporting the data.
Output
WriteAuxFile returns only one element in Output—any errors which may have occurred when attempting to execute the function.