Exemplo n.º 1
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static bool IsExternal(this BuildingElement buildingElement)
        {
            if (buildingElement == null || buildingElement.ElementProperties() == null || (buildingElement.ElementProperties() as ElementProperties) == null)
            {
                return(false);
            }

            return((buildingElement.ElementProperties() as ElementProperties).BuildingElementType == BuildingElementType.Roof); //TODO: Put a more robust check of whether the element is external or not in...
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static double UValue(this BuildingElement element)
        {
            if (element == null)
            {
                return(0);
            }
            if (element.ElementProperties() == null)
            {
                return(-1);
            }
            if ((element.ElementProperties() as ElementProperties) == null)
            {
                return(-1);
            }

            ElementProperties props = element.ElementProperties() as ElementProperties;

            if (props.Construction.UValues.Count == 0)
            {
                return(-1);
            }

            if (props.Construction.UValues.Count == 1)
            {
                return(props.Construction.UValues[0]);
            }

            switch (props.BuildingElementType)
            {
            case BuildingElementType.Ceiling:
                if (props.Construction.UValues.Count < 5)
                {
                    return(-1);
                }
                return(props.Construction.UValues[4]);

            case BuildingElementType.CurtainWall:
                if (props.Construction.UValues.Count < 7)
                {
                    return(-1);
                }
                return(props.Construction.UValues[6]);

            case BuildingElementType.Door:
                if (props.Construction.UValues.Count < 1)
                {
                    return(-1);
                }
                return(props.Construction.UValues[0]);

            case BuildingElementType.Floor:
                if (props.Construction.UValues.Count < 6)
                {
                    return(-1);
                }
                return(props.Construction.UValues[5]);    //Exposed floor would be 2...

            case BuildingElementType.Roof:
                if (props.Construction.UValues.Count < 2)
                {
                    return(-1);
                }
                return(props.Construction.UValues[1]);

            case BuildingElementType.Rooflight:
                if (props.Construction.UValues.Count < 7)
                {
                    return(-1);
                }
                return(props.Construction.UValues[6]);

            case BuildingElementType.Wall:
                if (props.Construction.UValues.Count < 4)
                {
                    return(-1);
                }
                return(props.Construction.UValues[3]);

            case BuildingElementType.Window:
                if (props.Construction.UValues.Count < 1)
                {
                    return(-1);
                }
                return(props.Construction.UValues[0]);    //Not sure if correct...

            case BuildingElementType.RooflightWithFrame:
                if (props.Construction.UValues.Count < 7)
                {
                    return(-1);
                }
                return(props.Construction.UValues[6]);

            case BuildingElementType.WindowWithFrame:
                if (props.Construction.UValues.Count < 1)
                {
                    return(-1);
                }
                return(props.Construction.UValues[0]);    //Not sure if correct...

            default:
                return(-1);
            }
        }