Example #1
0
 public static bool HasMergeablePropertiesWith(this IOpening element, IOpening other)
 {
     if (element == null || other == null)
     {
         return(false); //If either is null, then it can probably can't have its properties merged
     }
     return(element.GetType() == other.GetType());
 }
Example #2
0
        public static double SolidVolume(this IOpening opening)
        {
            if (opening is BH.oM.Physical.Elements.Void)
            {
                Engine.Reflection.Compute.RecordError("Voids contain no solid volume. Try querying the desired value another way.");
                return(0);
            }

            double area = opening.IArea();

            double thickness = 0;

            if (opening is Window)
            {
                thickness = (opening as Window).Construction.IThickness();
            }
            else if (opening is Door)
            {
                thickness = (opening as Door).Construction.IThickness();
            }

            double solidVolume = area * thickness;

            if (solidVolume <= 0)
            {
                Engine.Reflection.Compute.RecordError("Solid volume cannot be calculated for element of type :" + opening.GetType() + ". Returning zero volume.");
                return(0);
            }

            return(solidVolume);
        }
 public static bool HasMergeablePropertiesWith(this IOpening element, IOpening other)
 {
     return(element.GetType() == other.GetType());
 }