Revision history [back]
- Request the time series output variable
Electricity:Facility
atMonthly
resolution Get the data out of the sql file using something like this:
# Get the weather file run period (as opposed to design day run period) ann_env_pd = nil sql.availableEnvPeriods.each do |env_pd| env_type = sql.environmentType(env_pd) if env_type.is_initialized if env_type.get == OpenStudio::EnvironmentType.new("WeatherRunPeriod") ann_env_pd = env_pd end end end # Only try to get the annual peak demand if an annual simulation was run exit if ann_env_pd.empty? # Get the timeseries data elec = sql.timeSeries(ann_env_pd, "Monthly", "Electricity:Facility", "") if elec.is_initialized elec = elec.get elec.values.each do |val| # There should be 12 monthly values end end