IfcFile 中所有不同 IfcEntities 的列表

List of all different IfcEntities in IfcFile

总结

我的代码:

using (var model = IfcStore.Open(_FilePath))
{
    var allInstances = model.Instances;
    var testList = model.Instances.OfType<IIfcBuildingElement>();

    var nameList = new List<string>();
    var objTypeList = new List<string>();
    foreach (var item in testList)
    {
        var objType = item.IsTypedBy;
        var firstObjType = objType.ElementAt(0);
        var relType = firstObjType.RelatingType;

        var name = item.Name;
        nameList.Add(name);
    }
}

我的期望:

非常感谢任何帮助

感谢@martin1cerny

答案很简单:

var testList = model.Instances.OfType<IIfcBuildingElement>().GroupBy(e => e.GetType());

issue/question on github