Getting started

Python

You will need an installation of python to get started. We recommend installing the latest miniconda with Python 3.8. (for example from: https://docs.conda.io/en/latest/miniconda.html). Alternatively you can use your preferred way to install python.

Once you’ve installed miniconda open an Anaconda prompt and type the following to create an environment. You will need to download the python package here: windproapi-3.6-py3-none-any.whl and install the needed packages:

conda create --name wpapi
conda activate wpapi
conda install pip
pip install YOUR_LOCAL_PATH/windproapi-3.6-py3-none-any.whl

The last line will install a windPRO API Python library that has utilities for starting windPRO in API mode and other useful functions. You need to replace “YOUR_LOCAL_PATH” with the correct path of the downloaded file. You should now be ready to start writing your first windPRO API Python script. Create an empty file called myfirstwpapitest.py and add the following python code:

import windproapi.windproapi
import time

windproapi = windproapi.windproapi.WindProApi()
windproapi.start_windpro_with_port()

time.sleep(10)

windproapi.close_windpro()

This very first script will just start windPRO and wait 10 seconds and then close it again. You run it like this:

python myfirstwpapitest.py

In order to test that windPRO scripting services is also working the next step is to access the Windpro Service service before closing windPRO.

wp_service = windproapi.get_service('WindproService')
version = wp_service.GetVersion()
print(version)

The first line will use the SOAP protocol (via the Zeep Library) to access the Windpro Service service. So the complete test script now looks like this:

import windproapi.windproapi
import time

windproapi = windproapi.windproapi.WindProApi()
windproapi.start_windpro_with_port()


wp_service = windproapi.get_service('WindproService')
version = wp_service.GetVersion()
print(windproapi.api_port)
print(version)

time.sleep(10)

windproapi.close_windpro()

Run the test script again like this:

python myfirstwpapitest.py

You should see windPRO starting and then in the prompt where you run the script it should print out the port you are using and the current windPRO version and then close windPRO again.

This documentation

The way this documentation is written is focussed on executable example code for each service. Examples are included under the description of each individual service and a list of all the examples is available Python Examples. Examples either building a windPRO proejct from scratch or need some of the windPRO Sample projects available from the windPRO GUI.

Within this documentation you will find introductions to functionality in windPRO scripting. The descriptions and example will give you an idea of the available functionality, but not all functions available in a service are necessarily listed. A complete list of all methods is included in a simple auto-generated documentation is included in Overview Services. It includes all services and their associated methods, together with the required input and output. Within each of these services is a list of methods that can be used with its associated inputs and outputs. The lists of inputs can be very long, but most of the values are set by default when generating the object, same as in windPRO when an object is generated.

Often you will need a special datatype to set some properties. A list of all special data types are also available Data Types. This includes many enums, essentially lists of strings that describe the state of the property. More complex data types are also documented. These are for example the objects that are returned when you GetOBEJCT for a windPRO object or GetCALCULATION for a calculation.