Revit, how to get the XYZ corner points on a selected wall? This isn't the endpoints

1.1k Views Asked by At

I require the points on the edge across the width(narrow end) not the length(long end). Please understand this as the bounding box wont work! //these are not useful as they are points on the fixed cartesian plane x,y,z I cannot consistently get X min and max as the wall can be rotated in any orientation.

//**Wall0
BoundingBoxXYZ Wall0_BB = wall0.get_BoundingBox(null);
XYZ vector1 = Wall0_BB.Min;
XYZ vector2 = new XYZ(Wall0_BB.Max.X, Wall0_BB.Min.Y, Wall0_BB.Min.Z);
XYZ vectorA = vector1 - vector2; 



//these are not useful as they won't give me the corner points
LocationCurve locationcurve0 = wall0.Location as LocationCurve;
Line line0 = locationcurve0.Curve as Line;
XYZ pointA0 = line0.GetEndPoint(0);
XYZ pointA1 = line0.GetEndPoint(1);
1

There are 1 best solutions below

0
On

I gave up with he above after finding a method to get the interior or exterior face, from there you can get the curve on the side that you want and then an endpoint, using the property .endpoint(int Int) IList ThisSideFace = HostObjectUtils.GetSideFaces(wall0, ShellLayerType.Interior);