public static SpaceSimulationResult SpaceSimulationResult(this ZoneData zoneData, int index, LoadType loadType, SizingMethod sizingMethod) { if (zoneData == null || index == -1 || loadType == LoadType.Undefined) { return(null); } string name = zoneData.name; string reference = zoneData.zoneGUID; double area = zoneData.floorArea; double volume = zoneData.volume; float dryBulbTemp = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.dryBulbTemp); float resultantTemp = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.resultantTemp); float load = zoneData.GetHourlyZoneResult(index, loadType == LoadType.Cooling ? (short)tsdZoneArray.coolingLoad : (short)tsdZoneArray.heatingLoad); float infVentGain = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.infVentGain); float airMovementGain = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.airMovementGain); float buildingHeatTransfer = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.buildingHeatTransfer); float externalConductionGlazing = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.externalConductionGlazing); float externalConductionOpaque = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.externalConductionOpaque); float spaceHumidityRatio = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.humidityRatio); SpaceSimulationResult result = null; if (loadType == LoadType.Heating) { result = Analytical.Create.SpaceSimulationResult(name, Query.Source(), reference, volume, area, LoadType.Heating, load, index, sizingMethod, dryBulbTemp, resultantTemp, infiltartionGain: infVentGain, airMovementGain: airMovementGain, buildingHeatTransfer: buildingHeatTransfer, glazingExternalConduction: externalConductionGlazing, opaqueExternalConduction: externalConductionOpaque, humidityRatio: spaceHumidityRatio); } else if (loadType == LoadType.Cooling) { float solarGain = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.solarGain); float lightingGain = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.lightingGain); float occupancySensibleGain = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.occupantSensibleGain); float equipmentSensibleGain = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.equipmentSensibleGain); float equipmentLatentGain = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.equipmentLatentGain); float occupancyLatentGain = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.occupancyLatentGain); float relativeHumidity = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.relativeHumidity); float zoneApertureFlowIn = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.zoneApertureFlowIn); float zoneApertureFlowOut = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.zoneApertureFlowOut); float pollutant = zoneData.GetHourlyZoneResult(index, (short)tsdZoneArray.pollutant); result = Analytical.Create.SpaceSimulationResult(name, Query.Source(), reference, volume, area, loadType, load, index, sizingMethod, dryBulbTemp, resultantTemp, solarGain, lightingGain, infVentGain, airMovementGain, buildingHeatTransfer, externalConductionGlazing, externalConductionOpaque, occupancySensibleGain, occupancyLatentGain, equipmentSensibleGain, equipmentLatentGain, spaceHumidityRatio, relativeHumidity, zoneApertureFlowIn, zoneApertureFlowOut, pollutant); } if (result == null) { return(null); } List <double> dryBulbTemperatures = zoneData.AnnualZoneResult <double>(tsdZoneArray.dryBulbTemp); if (dryBulbTemperatures != null) { result.SetValue(SpaceSimulationResultParameter.DryBulbTemperatureProfile, new Profile("Dry Bulb Temperature", "Annual Space Values", dryBulbTemperatures)); } result.SetValue(SpaceSimulationResultParameter.ZoneGuid, zoneData.zoneGUID); ParameterSet parameterSet = ParameterSet_SpaceSimulationResult(ActiveSetting.Setting, zoneData); if (parameterSet != null) { result.Add(parameterSet); } return(result); }