Using VELocate() on model that isn't open

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
bbrannon4
VE Professor
VE Professor
Posts: 111
Joined: Wed Feb 12, 2014 6:56 pm

Using VELocate() on model that isn't open

Post by bbrannon4 »

I'm working on a script to pull some data based on a selected annual results file. I'd also like to include some non-results file specific project metadata, sat latitude and longitude for example. In the show_location_and_weather.py example file it just references the model that's open, and I can't find any documentation on how to pass a different model reference. Does anyone have any ideas? I also don't quite understand what VELocate() itself does (it's never mentioned in the documentation) and what the purpose of open_wea_data() is, since it's doesn't actually return anything. Part of the example file code:

Code: Select all

    # create the API object for ApLocate data
    loc = iesve.VELocate()

    # read the data for the current project
    loc.open_wea_data()

    # get the currently available ApLocate data as a dictionary
    data = loc.get()
    
enerGwizz
VE Student
VE Student
Posts: 46
Joined: Thu Mar 01, 2012 6:36 pm
Location: Los Angeles

Re: Using VELocate() on model that isn't open

Post by enerGwizz »

Hi Ben,
I'm not positive, but I don't think you can do that for a project that isn't open. What you MIGHT be able to do is to determine the weather file used from the results file you're opening. Then go directly to the weather file to open it and extract the lat/long from that. EPW files are a csv-like text-based file, so you can read them with Python.

Also, FYI.. VELocate data is stored a bit inconsistently depending on how the user set the location. For example, if you use the wizard and follow the steps to select a location, city/state/country fields will be saved one way. If you use the map app within ApLocate to search and find your project location, the data will be saved differently. If your scripts are just for your own models, and you always do this the same way, it shouldn't be an issue.
--
Greg
Post Reply