Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Cloning ZoneHVACUniHeater failed to addToThermalZone

Hi, I am trying to clone a ZoneHVACUnitHeater from a seed .osm file. I was able to successfully clone the heater (heater_in_zone), but was not able to add the unit heater to a thermal zone (thermalZone). My lines of code are:

Load Heater components unless "no heater" is selected

 if heater_name.eql?("No Heater")
 else
    heat = true
    heater_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/resources/#{heater_name}.osm")
    heater_inputmodel=translator.loadModel(heater_path)
    heater_inputmodel=heater_inputmodel.get
    heater_in_zone=heater_inputmodel.getZoneHVACUnitHeaters[0]

  end

heater_clone = heater_in_zone.clone(model).to_ZoneHVACUnitHeater.get heater_clone.addToThermalZone(thermalZones)

When run, the following error occurs: "Expected argument 1 of type openstudio::model::ThermalZone &, but got Array [#<openstudio::model::thermalzon....in swig="" method="" 'addtothermalzone.'"<="" p="">

I'm pretty new to Ruby so am not sure the correct protocol for cloning objects. If anyone could help me that would be great!

Cloning ZoneHVACUniHeater failed to addToThermalZone

Hi, I am trying to clone a ZoneHVACUnitHeater ZoneHVACUnitHeater from a seed .osm file. I was able to successfully clone the heater (heater_in_zone), but was not able to add the unit heater to a thermal zone (thermalZone). My lines of code are:

# Load Heater components unless "no heater" is selected

selected
     if heater_name.eql?("No Heater")
  else
     heat = true
     heater_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/resources/#{heater_name}.osm")
     heater_inputmodel=translator.loadModel(heater_path)
     heater_inputmodel=heater_inputmodel.get
     heater_in_zone=heater_inputmodel.getZoneHVACUnitHeaters[0]

   end

heater_clone = heater_in_zone.clone(model).to_ZoneHVACUnitHeater.get heater_clone.addToThermalZone(thermalZones)

heater_clone.addToThermalZone(thermalZones)

When run, the following error occurs: occurs:

"Expected argument 1 of type openstudio::model::ThermalZone &, but got Array [#<openstudio::model::thermalzon....in swig="" method="" 'addtothermalzone.'"<="" p="">

Array [#<OpenStudio::Model::ThermalZon....in SWIG method 'addToThermalZone.'"

I'm pretty new to Ruby so am not sure the correct protocol for cloning objects. If anyone could help me that would be great!

Cloning ZoneHVACUniHeater failed to addToThermalZone

Hi, I am trying to clone a ZoneHVACUnitHeater from a seed .osm file. I was able to successfully clone the heater (heater_in_zone), but was not able to add the unit heater to a thermal zone (thermalZone). My lines of code are:

# Load Heater components unless "no heater" is selected
     if heater_name.eql?("No Heater")
     else
        heat = true
        heater_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/resources/#{heater_name}.osm")
        heater_inputmodel=translator.loadModel(heater_path)
        heater_inputmodel=heater_inputmodel.get
        heater_in_zone=heater_inputmodel.getZoneHVACUnitHeaters[0]

      end

heater_clone = heater_in_zone.clone(model).to_ZoneHVACUnitHeater.get
heater_clone.addToThermalZone(thermalZones)

When run, the following error occurs:

"Expected argument 1 of type openstudio::model::ThermalZone &, but got Array [#<OpenStudio::Model::ThermalZon....in SWIG method 'addToThermalZone.'"

I'm pretty new to Ruby so am not sure the correct protocol for cloning objects. If anyone could help me that would be great!

Cloning ZoneHVACUniHeater failed to addToThermalZone

Hi, I am trying to clone a ZoneHVACUnitHeater from a seed .osm file. I was able to successfully clone the heater (heater_in_zone), but was not able to add the unit heater to a thermal zone (thermalZone). My lines of code are:

# Load Heater components unless "no heater" is selected
     if heater_name.eql?("No Heater")
     else
        heat = true
        heater_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/resources/#{heater_name}.osm")
        heater_inputmodel=translator.loadModel(heater_path)
        heater_inputmodel=heater_inputmodel.get
        heater_in_zone=heater_inputmodel.getZoneHVACUnitHeaters[0]

      end

heater_clone = heater_in_zone.clone(model).to_ZoneHVACUnitHeater.get
heater_clone.addToThermalZone(thermalZones)

When run, the following error occurs:

"Expected argument 1 of type openstudio::model::ThermalZone &, but got Array [#<OpenStudio::Model::ThermalZon....in SWIG method 'addToThermalZone.'"

I'm pretty new to Ruby so am not sure the correct protocol for cloning objects. If anyone could help me that would be great!

Cloning ZoneHVACUniHeater failed to addToThermalZone

Hi, I am trying to clone a ZoneHVACUnitHeater from a seed .osm file. I was able to successfully clone the heater (heater_in_zone), but was not able to add the unit heater to a thermal zone (thermalZone). My lines of code are:

# Load Heater components unless "no heater" is selected
     if heater_name.eql?("No Heater")
     else
        heat = true
        heater_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/resources/#{heater_name}.osm")
        heater_inputmodel=translator.loadModel(heater_path)
        heater_inputmodel=heater_inputmodel.get
        heater_in_zone=heater_inputmodel.getZoneHVACUnitHeaters[0]

      end

heater_clone = heater_in_zone.clone(model).to_ZoneHVACUnitHeater.get
heater_clone.addToThermalZone(thermalZones)

When run, the following error occurs:

"Expected argument 1 of type openstudio::model::ThermalZone &, but got Array [#<OpenStudio::Model::ThermalZon....in SWIG method 'addToThermalZone.'"

I'm pretty new to Ruby so am not sure the correct protocol for cloning objects. If anyone could help me that would be great!