[英]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);
}
I just answered your question on how to get all the points on the edge of the floor in the Revit API discussion forum : 我刚刚在Revit API讨论论坛中回答了有关如何获取所有要点的 问题 :
You can add a geometric location filter, eg, using a BoundingBoxIntersectsFilter . 您可以添加几何位置过滤器,例如,使用BoundingBoxIntersectsFilter 。
Here are some examples: 这里有些例子:
http://thebuildingcoder.typepad.com/blog/2013/03/filter-for-family-instances-in-a-room.html http://thebuildingcoder.typepad.com/blog/2013/03/filter-for-family-instances-in-a-room.html
http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.9 http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.9
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.