Scripting inside WindFarmer
Introduction
WindFarmer offers a comprehensive development environment for script editing, allowing users to manage scripts, compile and check syntax errors, and edit the user interface. Everything is available within WindFarmer itself, so there's no need to install anything else to run an existing script. The development environment provides all the tools needed to create high-quality scripts quickly and easily.
Use the C# or Python programming languages to build your workbook, update parameters in the workbook and execute functionality, such as running calculations.
Script Editor
To launch the script editor click on the 'Script Editor' button in the Quick Access Toolbar in the left of the application's title bar (highlighted in red below):
The Script Editor allows you to write and run scripts. You can create multiple scripts that are saved in the current workbook.
You can discover what is available by using the built-in intellisense functionality. When you type a variable and press the '.' keyboard key, the list of available properties shows in a popup menu. Choose one of the available properties (with the mouse or arrow keyboard keys) and press Return to add that property.
'Workbook' for accessing the workbook settings
There is an object called Workbook (of type Workbook
) that you can use to access the properties of the current workbook. Use the intellisense to navigate the various properties and sub-properties.
'Toolbox' for accessing the calculation toolbox
There is an object called Toolbox (of type Toolbox
) that you can use to access various functions for working with the workbook.
Use Toolbox.Log()
to write text to the output panel. Useful for viewing the values of variables.