Understanding VE Documentation

The VE Python API allows users create simple programs using the Python Programming Language, to interact with a VE Model and/or Vista Results File
Post Reply
NebK22
VE Student
VE Student
Posts: 35
Joined: Fri Feb 12, 2016 2:04 am

Understanding VE Documentation

Post by NebK22 »

Hi all,

Beginner python user here. I've gone through the User Guide, but I still have a lot of questions. At the moment, I'm playing with the list of available methods within the iesve class, but am struggling to even call certain methods properly.

For instance, on page 19, 6.1.1, it goes over AirExchange. I was trying to call the method get() below:

Code: Select all

import iesve 

#6.1.1 Air Exchange page 19
proj = iesve
airexchange = proj.AirExchange
print(airexchange.get())

But this gives me an ArgumentError :

Code: Select all

Traceback (most recent call last):
  File "C:\Users\BXK\Desktop\Local Projects\BXK VE Scripts\Test\hello.py", line 7, in <module>
    proj.get()
Boost.Python.ArgumentError: Python argument types in
    AirExchange.get()
did not match C++ signature:
    get(class AirExchange {lvalue})
  >>> Runtime: 0.00 seconds
Based on the userguide, the get() method doesn't take in any arguments. Am I interpreting the User Guide wrong? Why am I getting this error and how can I call the methods listed in the VE documentation?

Big thanks!
Ben K
Mechanical Designer :shock:
User avatar
Rhind
IES Staff
IES Staff
Posts: 87
Joined: Fri Mar 22, 2013 5:06 pm

Re: Understanding VE Documentation

Post by Rhind »

Hi,

You are using 'get()' correctly but there is an issue with the creation of your 'AirExchange' object.

Here's a simple script that will do what you want:

Code: Select all

import iesve 

# we will get the list of defined air exchanges
# in order to do this, we start with the currently loaded VE project
project = iesve.VEProject.get_current_project()

# get list of known air exchange objects from the project:
air_exchanges = project.air_exchanges()

# Print information about individual air exchanges:
for air_exchange in air_exchanges:
    # query the air exchange object for its data
    air_exchange_data = air_exchange.get()
    
    # print the available data to output
    print(air_exchange_data)
 
I recommend taking a look through the samples that are included with the VE. They are a great way of getting started.

Hope that helps.
Post Reply