Adds check for placement relative to self

This commit is contained in:
Richard Brice
2023-12-12 14:58:18 -08:00
parent 7fef3efbeb
commit c33f68fb99
+5 -1
View File
@@ -156,7 +156,11 @@ void IfcHierarchyHelper<Schema>::relatePlacements(typename Schema::IfcProduct* p
if (place && place->declaration().is(Schema::IfcLocalPlacement::Class())) {
typename Schema::IfcLocalPlacement* local_place = (typename Schema::IfcLocalPlacement*)place;
if (parent->ObjectPlacement()) {
local_place->setPlacementRelTo(parent->ObjectPlacement());
if (local_place != parent->ObjectPlacement()) {
local_place->setPlacementRelTo(parent->ObjectPlacement());
} else {
Logger::Notice("Placement cannot be relative to self");
}
}
}
}