diff --git a/src/examples/IfcOpenHouse.cpp b/src/examples/IfcOpenHouse.cpp index 6e94117858..7bac6dff70 100644 --- a/src/examples/IfcOpenHouse.cpp +++ b/src/examples/IfcOpenHouse.cpp @@ -408,6 +408,8 @@ int main() { IfcSchema::IfcDoorStyle* door_style = new IfcSchema::IfcDoorStyle(guid(), file.getSingle(), "Door type"s, null, null, null, null, null, IfcSchema::IfcDoorStyleOperationEnum::IfcDoorStyleOperation_SINGLE_SWING_LEFT, IfcSchema::IfcDoorStyleConstructionEnum::IfcDoorStyleConstruction_WOOD, false, false); + // NOTE: typing by IfcDoorStyle will cause validation errors in IFC4+ but it's allowed for backwards compatibility + // better to use IfcDoorType in the actual use case file.addRelatedObject(door_style, door); // Surface styles are assigned to representation items, hence there is no real limitation to diff --git a/src/ifcparse/IfcHierarchyHelper.h b/src/ifcparse/IfcHierarchyHelper.h index 04db4d8dd3..6bdc171ca9 100644 --- a/src/ifcparse/IfcHierarchyHelper.h +++ b/src/ifcparse/IfcHierarchyHelper.h @@ -453,8 +453,8 @@ class IFC_PARSE_API IfcHierarchyHelper : public IfcParse::IfcFile { } int relating_index = 4; int related_index = 5; - if (T::Class().name() == "IfcRelContainedInSpatialStructure") { - // IfcRelContainedInSpatialStructure has attributes reversed. + if (T::Class().name() == "IfcRelContainedInSpatialStructure" || std::is_base_of::value) { + // some classes have attributes reversed. std::swap(relating_index, related_index); } {