xBimTeam / XbimEssentials

A .NET library to work with data in the IFC format. This is the core component of the Xbim Toolkit
https://xbimteam.github.io/
Other
506 stars 174 forks source link

IFC validation error #508

Open GVladislavG opened 1 year ago

GVladislavG commented 1 year ago

Hello, xBim team! I got this validation error IfcBuilding '{label}' has null IIfcSite (invalid parent){} while analizing IFC file, created with xBim. But BimVision shows project hierarchy correctly. Building is attached to IfcSite. What is the reason of this problem?

Thanks!

martin1cerny commented 1 year ago

Where is this validation error coming from?

GVladislavG commented 1 year ago

It's comming from one of viewers, that makes this validation and refuse to process IFC-file. IfcBuilding.IfcSite is readonly property and I couldn't find the way to set it.

martin1cerny commented 1 year ago

Do you use IfcRelAggregates as shown in the documentation? https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/link/ifcspatialstructureelement.htm

GVladislavG commented 1 year ago

Yes, I do. I tried two ways ifcSite?.IsDecomposedBy.FirstOrDefault().RelatedObjects.Add(building); and ifcSite?.AddBuilding(building); And both doesn't set buiding.Site property... Result IFC-file is attached test.zip

martin1cerny commented 1 year ago

Have you checked the actual IFC file you have created? Does it contain the aggregation relation?

GVladislavG commented 1 year ago

How can I check it?

martin1cerny commented 1 year ago

Just open the IFC file in text editor and check if there is IfcRelAggregates object connecting the site and the building.

GVladislavG commented 1 year ago

Yes, result IFC (in test.zip) contains aggregation relation. IfcRelAggregates object is connecting the site and the building and also the storey and IfcBuildingElementProxy

martin1cerny commented 1 year ago

In that case, you will probably need to raise the question on the other side - with the developers of the application complaining about the missing 'property'.