There are three types of BoundaryConditions:
The type and pertinent geometry information is retrieved using the following code:
Code Region 29-9: Getting boundary condition type and geometry |
public void GetInfo_BoundaryConditions(BoundaryConditions boundaryConditions) { string message = "BoundaryConditions : "; boundaryConditions.GetBoundaryConditionsType(); switch (boundaryConditions.GetBoundaryConditionsType()) { case BoundaryConditionsType.Point: XYZ point = boundaryConditions.Point; message += "\nThis BoundaryConditions is a Point Boundary Conditions."; message += "\nLocation point: (" + point.X + ", " + point.Y + ", " + point.Z + ")"; break; case BoundaryConditionsType.Line: message += "\nThis BoundaryConditions is a Line Boundary Conditions."; Curve curve = boundaryConditions.GetCurve(); // Get curve start point message += "\nLocation Line: start point: (" + curve.GetEndPoint(0).X + ", " + curve.GetEndPoint(0).Y + ", " + curve.GetEndPoint(0).Z + ")"; // Get curve end point message += "; end point:(" + curve.GetEndPoint(1).X + ", " + curve.GetEndPoint(1).Y + ", " + curve.GetEndPoint(1).Z + ")"; break; case BoundaryConditionsType.Area: message += "\nThis BoundaryConditions is an Area Boundary Conditions."; IList<CurveLoop> loops = boundaryConditions.GetLoops(); foreach (CurveLoop curveLoop in loops) { foreach (Curve areaCurve in curveLoop) { // Get curve start point message += "\nCurve start point:(" + areaCurve.GetEndPoint(0).X + ", " + areaCurve.GetEndPoint(0).Y + ", " + areaCurve.GetEndPoint(0).Z + ")"; // Get curve end point message += "; Curve end point:(" + areaCurve.GetEndPoint(1).X + ", " + areaCurve.GetEndPoint(1).Y + ", " + areaCurve.GetEndPoint(1).Z + ")"; } } break; default: break; } TaskDialog.Show("Revit",message); } |