Exemplo n.º 1
0
        public static BHE.Building ToBHoM(this BHX.Building gbBuilding)
        {
            BHE.Building building = new BHE.Building();

            building.Name = gbBuilding.Name;
            BHP.BuildingContextFragment props = new BHP.BuildingContextFragment();
            props.PlaceName = gbBuilding.StreetAddress;
            building.Fragments.Add(props);
            building.CustomData.Add("Building Name", gbBuilding.BuildingType);

            return(building);
        }
Exemplo n.º 2
0
        public static BHX.Building ToGBXML(this BHE.Building building)
        {
            BHX.Building gbBuilding = new BHX.Building();

            gbBuilding.Name = building.Name;

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

            if (context != null)
            {
                gbBuilding.StreetAddress = context.PlaceName;
            }

            if (building.CustomData.ContainsKey("Building Name"))
            {
                gbBuilding.BuildingType = (building.CustomData["Building Name"]).ToString();
            }

            return(gbBuilding);
        }