Fixes bug in addRelatedObject<> for IfcRelReferencedInSpatialStructure

This commit is contained in:
Richard Brice
2026-04-23 08:40:05 -07:00
committed by Thomas Krijnen
parent 60cb034df7
commit 24a40625d1
+1 -1
View File
@@ -201,7 +201,7 @@ class IFC_SCHEMA_API hierarchy_helper : public ifcopenshell::file {
t.set_attribute_value(1, owner_history);
int relating_index = 4;
int related_index = 5;
if (T::Class().name() == "IfcRelContainedInSpatialStructure" || std::is_base_of<typename Schema::IfcRelDefines, T>::value) {
if (T::Class().name() == "IfcRelContainedInSpatialStructure" || T::Class().name() == "IfcRelReferencedInSpatialStructure" || std::is_base_of<typename Schema::IfcRelDefines, T>::value) {
// some classes have attributes reversed.
std::swap(relating_index, related_index);
}