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

        public static ElementProperties ElementProperties(BuildingElementType buildingElementType)
        {
            return(new ElementProperties
            {
                BuildingElementType = buildingElementType
            });
        }
コード例 #2
0
 public static ElementProperties ElementProperties(BuildingElementType elementType = BuildingElementType.Undefined, Construction construction = null)
 {
     return(new ElementProperties
     {
         BuildingElementType = elementType,
         Construction = construction,
     });
 }
コード例 #3
0
        public static bool ExposedToSun(this BuildingElement element)
        {
            if ((element.ElementProperties() as ElementProperties) != null)
            {
                BuildingElementType elementType = (element.ElementProperties() as ElementProperties).BuildingElementType;
                if (elementType == BuildingElementType.Roof || elementType == BuildingElementType.Rooflight || elementType == BuildingElementType.RooflightWithFrame || elementType == BuildingElementType.WallExternal)
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #4
0
 /// <summary>
 /// Sets TAS Building Element Building Element Type
 /// </summary>
 /// <param name="BuildingElement">Building Element</param>
 /// <param name="BuildingElementType">Building Element Type</param>
 /// <returns name="BuildingElement">Building Element</returns>
 /// <search>
 /// TAS, BuildingElement, Building Element, BE Type, BEType, betype, be type, SetBuildingElementType, Set Building Element Type
 /// </search>
 public static BuildingElement SetBuildingElementType(BuildingElement BuildingElement, BuildingElementType BuildingElementType)
 {
     BuildingElement.pBuildingElement.BEType = (int)BuildingElementType;
     return(BuildingElement);
 }
コード例 #5
0
 public GameObject InstantiateBuildingElement(BuildingElementType buildingElementType)
 {
     return(Instantiate(_buildingElementTypes[(int)buildingElementType]));
 }
コード例 #6
0
 public static List <IBuildingObject> ObjectsWithoutElementType(this List <IBuildingObject> elements, BuildingElementType type)
 {
     return(elements.Where(x => x.ElementProperties() != null && (x.ElementProperties() as ElementProperties).BuildingElementType != type).ToList());
 }
コード例 #7
0
        public static List <BuildingElement> ElementsWithoutType(this List <BuildingElement> elements, BuildingElementType type)
        {
            List <IBuildingObject> objs = elements.ConvertAll(x => (IBuildingObject)x).ToList();

            return(objs.ObjectsWithoutElementType(type).ConvertAll(x => (BuildingElement)x).ToList());
        }
コード例 #8
0
        public static List <BuildingElement> UpdateBuildingElementTypeByCustomData(this List <BuildingElement> elements)
        {
            //Temporary fix for Revit...
            foreach (BuildingElement be in elements)
            {
                if (be.CustomData.ContainsKey("Type SAM_BuildingElementType"))
                {
                    BuildingElementType bType = BuildingElementType.Undefined;
                    string type = be.CustomData["Type SAM_BuildingElementType"] as string;
                    type = type.ToLower();

                    if (type == "underground wall")
                    {
                        bType = BuildingElementType.UndergroundWall;
                    }
                    else if (type == "curtain wall")
                    {
                        bType = BuildingElementType.CurtainWall;
                    }
                    else if (type == "external wall")
                    {
                        bType = BuildingElementType.WallExternal;
                    }
                    else if (type == "internal wall")
                    {
                        bType = BuildingElementType.WallInternal;
                    }
                    else if (type == "no type")
                    {
                        bType = BuildingElementType.Undefined;
                    }
                    else if (type == "shade")
                    {
                        bType = BuildingElementType.Shade;
                    }
                    else if (type == "solar/pv panel")
                    {
                        bType = BuildingElementType.SolarPanel;
                    }
                    else if (type == "glazing")
                    {
                        bType = BuildingElementType.Glazing;
                    }
                    else if (type == "rooflight")
                    {
                        bType = BuildingElementType.Rooflight;
                    }
                    else if (type == "door")
                    {
                        bType = BuildingElementType.Door;
                    }
                    else if (type == "vehicle door")
                    {
                        bType = BuildingElementType.VehicleDoor;
                    }
                    else if (type == "roof")
                    {
                        bType = BuildingElementType.Roof;
                    }
                    else if (type == "underground ceiling")
                    {
                        bType = BuildingElementType.UndergroundCeiling;
                    }
                    else if (type == "internal floor")
                    {
                        bType = BuildingElementType.FloorInternal;
                    }
                    else if (type == "exposed floor")
                    {
                        bType = BuildingElementType.FloorExposed;
                    }
                    else if (type == "slab on grade")
                    {
                        bType = BuildingElementType.SlabOnGrade;
                    }

                    if ((be.ElementProperties() as ElementProperties) == null)
                    {
                        be.ExtendedProperties.Add(new ElementProperties());
                    }

                    (be.ElementProperties() as ElementProperties).BuildingElementType = bType;
                }
            }

            return(elements);
        }