public static List <IEnergyPlusClass> ToEnergyPlus(this BHE.Panel panel) { List <IEnergyPlusClass> classes = new List <IEnergyPlusClass>(); List <Point> vertices = BH.Engine.Environment.Query.Polyline(panel).ControlPoints(); vertices.RemoveAt(vertices.Count - 1); int vertexCount = vertices.Count; string panelName = panel.Name == "" ? panel.BHoM_Guid.ToString() : panel.Name; string zoneName = panel.ConnectedSpaces[0]; string sunExposure = panel.SunWindExposure() ? "SunExposed" : "NoSun"; string windExposure = panel.SunWindExposure() ? "WindExposed" : "NoWind"; GlobalGeometryRules globalGeometryRules = new GlobalGeometryRules(); classes.Add(globalGeometryRules); if (panel.Type == BHE.PanelType.Shade) { ShadingBuildingDetailed shadingSurface = new ShadingBuildingDetailed(); shadingSurface.Name = panelName; shadingSurface.Vertices = vertices; shadingSurface.NumberOfVertices = vertexCount; classes.Add(shadingSurface); } else { Zone zone = new Zone(); zone.Name = zoneName; classes.Add(zone); ZoneList zoneList = new ZoneList(); zoneList.ZoneNames.Add(zoneName); classes.Add(zoneList); if (panel.Construction == null) { panel = panel.AssignGenericConstructions(assignOpenings: true); } classes.AddRange(((Construction)panel.Construction).ToEnergyPlus()); BuildingSurfaceDetailed buildingSurface = new BuildingSurfaceDetailed(); string surfaceName = panelName; buildingSurface.Name = surfaceName; buildingSurface.SurfaceType = panel.Type.ToEnergyPlus(); buildingSurface.ConstructionName = panel.Construction.Name; buildingSurface.ZoneName = zoneName; buildingSurface.OutsideBoundaryCondition = panel.BoundaryCondition(); if (buildingSurface.OutsideBoundaryCondition == OutsideBoundaryCondition.Zone) { buildingSurface.OutsideBoundaryConditionObject = panel.ConnectedSpaces[-1]; } else { buildingSurface.OutsideBoundaryConditionObject = ""; } buildingSurface.SunExposure = sunExposure; buildingSurface.WindExposure = windExposure; buildingSurface.Vertices = vertices; buildingSurface.NumberOfVertices = vertexCount; classes.Add(buildingSurface); foreach (BHE.Opening o in panel.Openings) { classes.AddRange(o.ToEnergyPlus(panelName)); } } return(classes); }