Reading CLG and HTG files

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
dtnuno
VE Newbie
VE Newbie
Posts: 9
Joined: Fri Jan 24, 2020 10:00 am

Reading CLG and HTG files

Post by dtnuno »

Hello

I've searched the forum and found a post where someone was in need to interrogate HTG and CLG files. Since I am also in need for it and the solution presented in that post didn't work for me, I was wondering if the functionality changed into a new class or stopped being supported.

The solution was something along these lines:

Code: Select all

file_name = IesFilePicker.pick_vista_file([("APS files", "*.aps"), ("HTG files", "*.htg"), ("CLG files", "*.clg")], "Pick a results file")

with iesve.ResultsReader.open(file_name) as results_file_reader:
    assert results_file_reader is not None, "Error opening results file"
    aps_units = results_file_reader.get_units()
However, the output I receive is:

Code: Select all

Traceback (most recent call last):
  File "test.py", line 16, in <module>
    with iesve.ResultsReader.open(file_name) as results_file_reader:
FileNotFoundError: APS file not found: name_of_the_file.htg
Thank you in advance for all the help you can provide

Best Regards
User avatar
Rhind
IES Staff
IES Staff
Posts: 87
Joined: Fri Mar 22, 2013 5:06 pm

Re: Reading CLG and HTG files

Post by Rhind »

Hi,

Just tried the snippet and it seems to be working ok for me. This is the full script I ran:

Code: Select all

import iesve
from ies_file_picker import IesFilePicker

file_name = IesFilePicker.pick_vista_file([("APS files", "*.aps"), ("HTG files", "*.htg"), ("CLG files", "*.clg")], "Pick a results file")

with iesve.ResultsReader.open(file_name) as results_file_reader:
    assert results_file_reader is not None, "Error opening results file"
    aps_units = results_file_reader.get_units()
dtnuno
VE Newbie
VE Newbie
Posts: 9
Joined: Fri Jan 24, 2020 10:00 am

Re: Reading CLG and HTG files

Post by dtnuno »

Thank you for the reply. I don't know exactly why that file wasn't working but i tried with another htg and it works fine thank you.

On another note, if you could help me with another matter I have at hands, I'd be very grateful :)

When using the filereader to retrieve the variable list, I can't find any variable related to hvac component. (ie, model level "h"). I'm just trying to confirm if they do appear there since none of the aps files i tried so far, give me any results for this specific model level.

Thank you in advance
User avatar
Rhind
IES Staff
IES Staff
Posts: 87
Joined: Fri Mar 22, 2013 5:06 pm

Re: Reading CLG and HTG files

Post by Rhind »

They are there as long as you have enabled HVAC component results in the output options when running your simulation.

They are tied to specific components so you need to use get_hvac_component_results().
dtnuno
VE Newbie
VE Newbie
Posts: 9
Joined: Fri Jan 24, 2020 10:00 am

Re: Reading CLG and HTG files

Post by dtnuno »

Rhind wrote: Thu Jan 30, 2020 9:42 am They are there as long as you have enabled HVAC component results in the output options when running your simulation.

They are tied to specific components so you need to use get_hvac_component_results().
First of all, thank you for being patient with me.

Yes I will then use the function get_hvac_component_results() along with the ID I got from the hvac network. But even after I made a new simulation with everything ticked in the output options (made sure even hvac components were checked), I still get 0 vars from model_level 'h'

I tried with a few files already and I can see the results in VistaPro but can't get the variables through python API. Would there be something missing still?

Thank you in advance

Best regards
User avatar
Rhind
IES Staff
IES Staff
Posts: 87
Joined: Fri Mar 22, 2013 5:06 pm

Re: Reading CLG and HTG files

Post by Rhind »

If you can see them in Vista then the variables are available. Is the issue that they don't appear when calling get_variables()? I don't think component level variables are included in the output of that method. However you can still use them with get_component_results().
dtnuno
VE Newbie
VE Newbie
Posts: 9
Joined: Fri Jan 24, 2020 10:00 am

Re: Reading CLG and HTG files

Post by dtnuno »

T
Rhind wrote: Thu Jan 30, 2020 11:07 am If you can see them in Vista then the variables are available. Is the issue that they don't appear when calling get_variables()? I don't think component level variables are included in the output of that method. However you can still use them with get_component_results().
Yes, that would be correct. The issue is not being able to list/get the variables for the hvac components. As you mentioned, perhaps component level variables aren't included in that method. Would there be any way for me to retrieve that list by another means?

Thank you in advance
nikhil_makan
VE Newbie
VE Newbie
Posts: 4
Joined: Wed Feb 16, 2022 12:00 am

Re: Reading CLG and HTG files

Post by nikhil_makan »

@dtnuno did you by any chance have any success in reading the HVAC Component Results in the end? Or at least get a list of the apache HVAC component aps_var names? I am having the same issue and getting an error and I think its due to the variable name I am using.
Post Reply