Exemple #1
0
 public static IBuildingObject AddExtendedProperty(this IBuildingObject obj, IBHoMExtendedProperties properties)
 {
     if (obj == null)
     {
         return(null);
     }
     obj.ExtendedProperties.Add(properties);
     return(obj);
 }
Exemple #2
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static double Orientation(IBuildingObject buildingPanel)
        {
            Panel panel = buildingPanel as Panel;

            BHG.Polyline pLine = new BHG.Polyline {
                ControlPoints = panel.PanelCurve.IControlPoints()
            };

            List <BHG.Point> pts = pLine.DiscontinuityPoints();

            BHG.Plane plane = BH.Engine.Geometry.Create.Plane(pts[0], pts[1], pts[2]); //Some protection on this needed maybe?

            BHG.Vector xyNormal = BH.Engine.Geometry.Create.Vector(0, 1, 0);

            return(BH.Engine.Geometry.Query.Angle(plane.Normal, xyNormal) * (180 / Math.PI));
        }
Exemple #3
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static ICurve Bottom(this IBuildingObject buildingElementGeometry)
        {
            if (buildingElementGeometry == null)
            {
                return(null);
            }

            PolyCurve workingCurves = null;

            if (buildingElementGeometry is Panel)
            {
                workingCurves = (buildingElementGeometry as Panel).PanelCurve as PolyCurve;
            }
            else if (buildingElementGeometry is BuildingElement)
            {
                workingCurves = (buildingElementGeometry as BuildingElement).PanelCurve as PolyCurve;
            }
            else if (buildingElementGeometry is Opening)
            {
                workingCurves = (buildingElementGeometry as Opening).OpeningCurve as PolyCurve;
            }

            if (workingCurves == null)
            {
                return(null);
            }

            double aZ      = double.MaxValue;
            ICurve aResult = null;

            foreach (ICurve aCurve in workingCurves.Curves)
            {
                Point aPoint_Start = aCurve.IStartPoint();
                Point aPoint_End   = aCurve.IEndPoint();

                if (aPoint_End.Z <= aZ && aPoint_Start.Z <= aZ)
                {
                    aZ      = Math.Max(aPoint_End.Z, aPoint_Start.Z);
                    aResult = aCurve;
                }
            }
            return(aResult);
        }
Exemple #4
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static double Width(this IBuildingObject buildingObject)
        {
            return(Width(buildingObject as dynamic));
        }
Exemple #5
0
        /***************************************************/

        public static IBuildingObject Copy(this IBuildingObject buildingObject)
        {
            IBuildingObject aBuildingObject = Copy(buildingObject as dynamic);

            return(aBuildingObject);
        }
Exemple #6
0
 public static IBHoMExtendedProperties EnvironmentContextProperties(this IBuildingObject obj)
 {
     return(EnvironmentContextProperties(obj as dynamic));
 }
Exemple #7
0
 public static IBHoMExtendedProperties ElementProperties(this IBuildingObject obj)
 {
     return(ElementProperties(obj as dynamic));
 }
Exemple #8
0
 public static IBHoMExtendedProperties AnalyticalProperties(this IBuildingObject obj)
 {
     return(AnalyticalProperties(obj as dynamic));
 }
Exemple #9
0
 public static IBHoMExtendedProperties PropertiesByType(this IBuildingObject obj, Type propertyType)
 {
     return(obj.ExtendedProperties.Where(x => x.GetType() == propertyType).FirstOrDefault());
 }
Exemple #10
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static double Height(this IBuildingObject buildingObject)
        {
            return(Height(buildingObject as dynamic));
        }
Exemple #11
0
 public static ICurve ICurve(this IBuildingObject buildingObject)
 {
     return(Curve(buildingObject as dynamic));
 }
Exemple #12
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static IBuildingObject ISetGeometry(this IBuildingObject buildingObject, ICurve curve)
        {
            return(SetGeometry(buildingObject as dynamic, curve as dynamic));
        }