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

You are missing .get when you get the OSOptionalQuantity , so your code should look like that:

model.runSizingRun()
model.getAirLoopHVACs.each do |air_loop|
supply_components = air_loop.supplyComponents
    supply_components.each do |supply_component|
        unit = supply_component.to_FanVariableVolume
        if not unit.empty?  
        fan_vv = unit.get
        runner.registerInfo("#{fan_vv.name}")   
            if fan_vv.isMaximumFlowRateAutosized == true
            runner.registerInfo("Autosized")
            flow_rate = fan_vv.getMaximumFlowRate.get
            runner.registerInfo("#{flow_rate}")             
            else
            runner.registerInfo("Not Autosized")
            end
        end
    end
end

You are missing .get when you get assign the OSOptionalQuantity , so your code should look like that:

model.runSizingRun()
model.getAirLoopHVACs.each do |air_loop|
supply_components = air_loop.supplyComponents
    supply_components.each do |supply_component|
        unit = supply_component.to_FanVariableVolume
        if not unit.empty?  
        fan_vv = unit.get
        runner.registerInfo("#{fan_vv.name}")   
            if fan_vv.isMaximumFlowRateAutosized == true
            runner.registerInfo("Autosized")
            flow_rate = fan_vv.getMaximumFlowRate.get
            runner.registerInfo("#{flow_rate}")             
            else
            runner.registerInfo("Not Autosized")
            end
        end
    end
end