Revision history  [back]

You are missing .get when you 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

You are missing .get when you assign 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