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

Revision history [back]

I can't tell if you want C# or Python code since you mention C# bindings but are using IronPython, but this is @kyle-benne answer in Python.

from openstudio import model
m = model.Model()
air_loop = model.toAirLoopHVAC(model.addSystemType7(m)).get()
heating_coil = model.toCoilHeatingWater(air_loop.supplyComponents(model.CoilHeatingWater.iddObjectType).front()).get()
hot_water_plant = heating_coil.plantLoop().get()
boiler = model.toBoilerHotWater(hot_water_plant.supplyComponents(model.BoilerHotWater.iddObjectType).front()).get()
print(boiler.name())

I can't tell if you want C# or Python code since you mention C# bindings but are using IronPython, but this is @kyle-benne answer in Python.

from openstudio import model
 m = model.Model()
 air_loop = model.toAirLoopHVAC(model.addSystemType7(m)).get()
 heating_coil = model.toCoilHeatingWater(air_loop.supplyComponents(model.CoilHeatingWater.iddObjectType).front()).get()
 hot_water_plant = heating_coil.plantLoop().get()
 boiler = model.toBoilerHotWater(hot_water_plant.supplyComponents(model.BoilerHotWater.iddObjectType).front()).get()
 print(boiler.name())

I can't tell if you want C# or Python code since you mention C# bindings but are using IronPython, but this is @kyle-benne @kyle benne answer in Python.

from openstudio import model

m = model.Model()

air_loop = model.toAirLoopHVAC(model.addSystemType7(m)).get()

heating_coil = model.toCoilHeatingWater(air_loop.supplyComponents(model.CoilHeatingWater.iddObjectType).front()).get()

hot_water_plant = heating_coil.plantLoop().get()

boiler = model.toBoilerHotWater(hot_water_plant.supplyComponents(model.BoilerHotWater.iddObjectType).front()).get()

print(boiler.name())