简体   繁体   中英

Revit API: How can I count total point on the edge of the floor?

As my title, I want to know total endpoint located on the edge of the floor. Does anyone has a solution? My ideal maybe like this:

int i = 0;
FilteredElementCollector docCollector1 = new FilteredElementCollector(doc).OfClass(typeof(Point));
foreach(Point point in docCollector1)
{
  i++;
}
TaskDialog.Show("Revit","Have total {0} point on the edge of the floor ", i);

This's image about my problem: Edge has endpoint

I only wan't to know how many endpoint arround my floor.

I can identify 4 edge by this code, but I'm still don't know get all the point for each edge.

for (int i = 0; i < ea.Size; i++)
{
    Edge e = ea.get_Item(i);
        //Identify point located edge in here       
    IList<XYZ> exyz = e.Tessellate();
    int m = exyz.Count;
    XYZ sPoint = exyz[0];
    XYZ ePoint = exyz[m - 1];
    XYZ mPoint = new XYZ((sPoint.X + ePoint.X) / 2, (sPoint.Y + ePoint.Y) / 2, 0);          
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM