//get the host element of this opening message += "\nThe id of the opening's host element is : " + opening.Host.Id.IntegerValue; //get the information whether the opening has a rect boundary //If the opening has a rect boundary, we can get the geometry information from BoundaryRect property. //Otherwise we should get the geometry information from BoundaryCurves property if (opening.IsRectBoundary) { message += "\nThe opening has a rectangular boundary."; //array contains two XYZ objects: the max and min coords of boundary IList<XYZ> boundaryRect = opening.BoundaryRect; //get the coordinate value of the min coordinate point XYZ point = opening.BoundaryRect[0]; message += "\nMin coordinate point:(" + point.X + ", " + point.Y + ", " + point.Z + ")"; //get the coordinate value of the Max coordinate point point = opening.BoundaryRect[1]; message += "\nMax coordinate point: (" + point.X + ", " + point.Y + ", " + point.Z + ")"; } else { message += "\nThe opening doesn't have a rectangular boundary."; // Get curve number int curves = opening.BoundaryCurves.Size; message += "\nNumber of curves is : " + curves; for (int i = 0; i < curves; i++) { Autodesk.Revit.DB.Curve curve = opening.BoundaryCurves.get_Item(i); // Get curve start point message += "\nCurve start point: " + XYZToString(curve.GetEndPoint(0)); // Get curve end point message += "; Curve end point: " + XYZToString(curve.GetEndPoint(1)); } } TaskDialog.Show("Revit",message);