简体   繁体   English

Revit API:如何计算地板边缘的总点数?

[英]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. 我可以通过此代码识别出4条边,但我仍然不知道每个边的点数。

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);          
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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