我需要使用XBIM获取IfcWall对象的顶点列表。我需要的代码必须如下所示:
using (model)
{
List<ItemSet<IfcCartesianPoints>> loppsList = new List<ItemSet<IfcCartesianPoints>>();
var walls = model.Instances.OfType<IfcWall>();
foreach (var wall in walls)
{
loppsList.Add(wall. ... .Points);
}
}但我不知道,怎么才能找到合适的方法。
我尝试了这里提出的解决方案:IFC objects navigation to retrieve Wall coordinates
foreach (var wall in walls)
{
var line = wall.Representation.Representations[0].Items[0];
var _line = line as IfcPolyline;
loppsList.Add(_line.Points);
}但是我没有得到正确的数据--也许我只是迷失在属性的路径中。请帮助浏览IfcWall属性。
发布于 2020-01-12 16:46:31
好吧,如果将来有人会面临同样的问题,那么完整的答案是:
wall.Representation.Representations[].Items[].Outer[].CfsFaces[].Bounds[].Bound.Polygon[]
//this is how i print the x coordinates of all points
using (model)
{
var walls = model.Instances.OfType<IIfcWall>();
foreach (var wall in walls)
{
var loop = wall.Representation.Representations[1].Items[0];
if (loop is IfcFacetedBrep)
{
var _loop = loop as IfcFacetedBrep;
foreach (var face in _loop.Outer.CfsFaces)
{
foreach (var bound in face.Bounds)
{
var _b = bound.Bound as IIfcPolyLoop;
foreach (var point in _b.Polygon)
{
Debug.WriteLine(point.ToString());
}
}
}
}
}
}但是:
。
不要使用国际金融公司。
https://stackoverflow.com/questions/59682450
复制相似问题