Example #1
0
        public static BHA.Level ToBHoM(this BHX.BuildingStorey storey)
        {
            BHA.Level level = new BHA.Level();

            level.Name      = storey.Name;
            level.Elevation = storey.Level;

            return(level);
        }
Example #2
0
        public static BHX.BuildingStorey ToGBXML(this BHA.Level level, List <List <BHE.Panel> > spaces = null)
        {
            BHX.BuildingStorey storey = new BHX.BuildingStorey();

            if (spaces != null)
            {
                BHG.Polyline storeyGeometry = level.StoreyGeometry(spaces);
                if (storeyGeometry != null)
                {
                    storey.PlanarGeometry.PolyLoop = storeyGeometry.ToGBXML();
                }
            }

            storey.PlanarGeometry.ID = "level-planar-geometry-" + Guid.NewGuid().ToString().Replace("-", "").Substring(0, 10);
            storey.Name  = level.Name;
            storey.ID    = "Level-" + level.Name.Replace(" ", "").ToLower();
            storey.Level = (float)level.Elevation;

            return(storey);
        }