It is possible to write scripts for AWRDE in something other than Visual Basic such as Python, Perl, C#, etc. This article describes the setup for Python
AWRDE is a COM automation server and any programming language that can perform as a COM client can be used. This includes most current programming languages such as Python. With Python you will need to install the win32com.client library. The easiest way to do this is to use pip.
While this is the minimum setup, if you plan to do significant work in python you want to create the entire type library you will need to run makepy.py. In a command prompt...
If you run this with the -v option it will indicate the name of the generated python file in case you want to look at it. These definitions will be loaded automatically when you connect to AWRDE.
Testing your installation
Here is a very simple python program that connects to AWRDE and writes out all the models in the software:
Connecting to a Specific Instance of AWRDE
When you use this line:
It will connect to the most recent version of the AWR Design Environment installed, said another way, the version of the last AWR Design Environment Installer run.
To call a specific version, you will add the major version number such as:
If you have multiple instances of the AWR Design Environment running at the same time, you can follow the following procedure on how to pick which instance to connect.
First, in the AWR Design Environment, you need to go into the VB scripting and run
to get the CLSID of the instance you want to connect to. This will be something like:
Then, from within python, you use:
where you replace CLSID with the id you want to use.
Note the braces are required.