Autodesk / revit-ifc

IFC for Revit and Navisworks (2019+)
474 stars 193 forks source link

IfcCurveBoundedPlane : InnerBoundaries attribute is not optional #270

Open CyrilWaechter opened 3 years ago

CyrilWaechter commented 3 years ago

Despite what is said in ifc documentation description:

An optional set of inner boundaries.

IfcCurveBoundedPlane InnerBoundaries attribute is not optional as specified in EXPRESS specifications:

InnerBoundaries : SET [0:?] OF IfcCurve;

The SET can be empty but must exist as it is not prefixed with OPTIONAL. See https://github.com/IfcOpenShell/IfcOpenShell/issues/635#issuecomment-770376223

Example of current export from revit-ifc: #210= IFCCURVEBOUNDEDPLANE(#209,#204,$);

This apply for both IFC2X3 and IFC4.

AngelVelezSosa commented 3 years ago

How was this created? While I see in the code that the CreateCurveBoundedPlane does (incorrectly) allow for the option to have an optional InnerBoundaries attribute, I don't see anything in the code that actually passes in a null value.

CyrilWaechter commented 3 years ago

@AngelVelezSosa When your export IfcRelSpaceBoundary 2nd level (I did not test with 1st level). You can find a full sample file in .ifc and .rvt by following this link (Revit folder).

Edit: it seems to be assigned to space boundary here: https://github.com/Autodesk/revit-ifc/blob/5dc15d0c006c25c07d609275e8ea860ace13b081/Source/Revit.IFC.Export/Exporter/SpaceBoundary.cs#L95 but I don't know where the geometry is created.

Edit 2: space boundaries are created in this file https://github.com/Autodesk/revit-ifc/blob/5dc15d0c006c25c07d609275e8ea860ace13b081/Source/Revit.IFC.Export/Exporter/SpatialElementExporter.cs#L72

Edit 3: I see that an empty HashSet seems to be assigned here: https://github.com/Autodesk/revit-ifc/blob/5dc15d0c006c25c07d609275e8ea860ace13b081/Source/Revit.IFC.Export/Utility/ExporterUtil.cs#L1968

But I don't understand what happens after this: https://github.com/Autodesk/revit-ifc/blob/5dc15d0c006c25c07d609275e8ea860ace13b081/Source/Revit.IFC.Export/Utility/ExporterUtil.cs#L1973