0

Open Studio Ruby code - getting the existing HVAC air loop template

Hello, I tried using AI as a starting point to code an ASHP measure on Ruby to be used on Open Studio. Two lines of code are:

thermal_zone = thermal_zone.get
existing_template = thermal_zone.airLoopHVACTemplate

The second line is throwing an error, as the method "airLoopHVACTemplate" is undefined. I've been unsuccessful in finding documentation explaining this method - does anyone know what alternatives could be used to achieve what I am hoping to accomplish (get the existing HVAC air loop for the thermal zone)?

Thank you!

MDW's avatar
33
MDW
asked 2023-05-31 08:59:05 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2023-05-31 11:13:43 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

Don't think the SDK has an airLoopHVACTemplate method. You're likely after airLoopHVAC, which the ThermalZone class inherits from HVACComponent. An example.

Denis Bourgeois's avatar
2.8k
Denis Bourgeois
answered 2023-05-31 15:02:06 -0500
edit flag offensive 0 remove flag delete link

Comments

Exactly. Mind that this returns an OptionalAirLoopHVAC, eg a_ = z.airLoopHVAC, so you should check if !a_.empty? or a_.is_initialized before calling a = a_.get when a is now an AirLoopHVAC

Julien Marrec's avatar Julien Marrec (2023-06-01 02:02:51 -0500) edit

Got it - thank you both for the responses.

MDW's avatar MDW (2023-06-01 10:11:15 -0500) edit
add a comment see more comments