Introduction

Aurora Scripting is used to automate processes. Let's say you have a bunch of Aurora projects saved in a folder and you want to run them all. Instead of manually opening each and every project separately and running them, you can create a script to run all of the projects for you.

They way that the script communicates with Aurora is using the AC and ADS objects. The AURORA Commands (AC.) are used to accomplish specific project commands. It performs functions like "loading a project,"  "saving a project" or  "Running a simulation." Aurora Datasets (or ADS. object functions) are generally used to change project settings, or read and modify input and out tables. 

Aurora's scripting interface uses Visual Basic (VB) or C# languages to automate many of its utilities. Click the scripting button on the Tools menu to display the Aurora scripting interface. This is where you can create, edit, save, open and run script files or script projects. By default, the Scripting window opens a VB file.

When you first open the Scripting window, it will open a new VB file named “NewVBFile” and it will be created in your computer’s Temp folder. Use the Save/Save As buttons to save, rename, and relocate the file. For all functions in VB Files and Projects, the keyword “Shared” needs to be used when declaring a Sub or Function, i.e., Shared Sub Test(). For all functions in C# Files and Projects, the keyword “static” needs to be used when declaring functions, i.e., static void Test().

You can see import statements and a class declaration for Aurora. It also declares the AC. and ADS. objects in the script.

For any functions in your script, you will need to have the shared keyboard for it.

At the bottom of your screen, you can see the pathname of where the script is current being saved. You can also see the Script Status that will tell you whether or not a script is running.

 NOTE: Do not change data in scripting in conjunction with Risk or Change Sets. They are mutually exclusive. The "AURORARunToStudyStart" AURORA Command allows the user to loop through the iterations of a risk run and manipulate input data for each iteration. The only inputs that cannot be changed this way are input data related to the Risk input table and the frequency duration outage method.

Each script that is run must have a main subroutine, which is automatically created when New is chosen from the Scripting ribbon. You can put all of the VB Script code in the main subroutine or add additional subroutines as desired. Old script files, created prior to v14.0, were saved with the .xsp filename qualifier but will be converted to a .vb file when opened in Aurora 14.0 or later.

To view all AURORA Scripting Commands, simply type AURORACOMMAND. or AC. in the script editing window. A list of these commands is also available in AURORA Commands. After a command is inserted, you may need to supply additional information, such as a filename (text goes within "double quotes").

To view all of the AURORA Dataset Commands, type AURORADATASET. or ADS. in the script editing window.  A list of these commands is also available in AURORA Datasets.

Use scripts to modify any input data or access any project file settings in Aurora.  Scripts can also access data during the course of a simulation.

Scripting

Introduction


For further assistance, please contact Aurora Support.

Copyright© 1997-2024 Energy Exemplar LLC. All rights reserved.