Exemple #1
0
        public static BHE.Building ToBHoM(this BHX.Location location)
        {
            BHE.Building building = new oM.Environment.Elements.Building();

            building.Elevation = location.Elevation;
            building.Longitude = location.Longitude;
            building.Latitude  = location.Latitude;

            BHP.BuildingContextFragment props = new BHP.BuildingContextFragment();
            props.PlaceName      = location.Name;
            props.WeatherStation = location.StationID.ID;
            building.Fragments.Add(props);

            return(building);
        }
Exemple #2
0
        public static BHX.Location ToGBXMLLocation(this BHE.Building building)
        {
            BHX.Location location = new BHX.Location();
            location.Longitude = Math.Round(building.Longitude, 5);
            location.Latitude  = Math.Round(building.Latitude, 5);
            location.Elevation = Math.Round(building.Elevation, 5);

            BHP.BuildingContextFragment context = building.FindFragment <BHP.BuildingContextFragment>(typeof(BHP.BuildingContextFragment));

            if (context != null)
            {
                location.Name         = context.PlaceName;
                location.StationID.ID = context.WeatherStation;
            }

            return(location);
        }