public static IBuildingObject AddExtendedProperty(this IBuildingObject obj, IBHoMExtendedProperties properties) { if (obj == null) { return(null); } obj.ExtendedProperties.Add(properties); return(obj); }
/***************************************************/ /**** 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)); }
/***************************************************/ /**** 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); }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static double Width(this IBuildingObject buildingObject) { return(Width(buildingObject as dynamic)); }
/***************************************************/ public static IBuildingObject Copy(this IBuildingObject buildingObject) { IBuildingObject aBuildingObject = Copy(buildingObject as dynamic); return(aBuildingObject); }
public static IBHoMExtendedProperties EnvironmentContextProperties(this IBuildingObject obj) { return(EnvironmentContextProperties(obj as dynamic)); }
public static IBHoMExtendedProperties ElementProperties(this IBuildingObject obj) { return(ElementProperties(obj as dynamic)); }
public static IBHoMExtendedProperties AnalyticalProperties(this IBuildingObject obj) { return(AnalyticalProperties(obj as dynamic)); }
public static IBHoMExtendedProperties PropertiesByType(this IBuildingObject obj, Type propertyType) { return(obj.ExtendedProperties.Where(x => x.GetType() == propertyType).FirstOrDefault()); }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static double Height(this IBuildingObject buildingObject) { return(Height(buildingObject as dynamic)); }
public static ICurve ICurve(this IBuildingObject buildingObject) { return(Curve(buildingObject as dynamic)); }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static IBuildingObject ISetGeometry(this IBuildingObject buildingObject, ICurve curve) { return(SetGeometry(buildingObject as dynamic, curve as dynamic)); }