コード例 #1
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static List <BHG.Polyline> ClosedShellGeometry(this List <BuildingElement> buildingElements)
        {
            List <BHG.Polyline> pLinesCurtainWall = new List <BHG.Polyline>();
            List <BHG.Polyline> pLinesOther       = new List <BHG.Polyline>();

            //Merge curtain panels
            foreach (BuildingElement element in buildingElements)
            {
                BH.oM.Environment.Properties.ElementProperties beProperty = element.ElementProperties() as BH.oM.Environment.Properties.ElementProperties;
                BHG.Polyline pline = new BHG.Polyline()
                {
                    ControlPoints = element.PanelCurve.IControlPoints()
                };

                if (beProperty != null && beProperty.BuildingElementType == BuildingElementType.CurtainWall)
                {
                    pLinesCurtainWall.Add(pline);
                }
                else
                {
                    pLinesOther.Add(pline);
                }
            }

            //Add the rest of the geometries
            List <BHG.Polyline> mergedPolyLines = BH.Engine.Geometry.Compute.BooleanUnion(pLinesCurtainWall);

            mergedPolyLines.AddRange(pLinesOther);

            return(mergedPolyLines);
        }
コード例 #2
0
        public static List <BuildingElement> ShadingElements(this List <BuildingElement> elements)
        {
            //Isolate all of the shading elements in the list - shading elements are ones connected only along one edge
            List <BuildingElement> shadingElements = new List <BuildingElement>();

            foreach (BuildingElement be in elements)
            {
                BH.oM.Environment.Properties.ElementProperties props = be.ElementProperties() as BH.oM.Environment.Properties.ElementProperties;
                if (props != null)
                {
                    if (props.BuildingElementType == BuildingElementType.Shade)
                    {
                        shadingElements.Add(be);
                    }
                }
            }

            return(shadingElements);
        }