mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Catch decomposition errors #8149
This commit is contained in:
@@ -197,8 +197,14 @@ std::vector<express::Base> mapping::find_openings(const express::Base& inst) {
|
||||
// Only aggregation, not nesting is considered.
|
||||
break;
|
||||
}
|
||||
auto rel_obdef = decomposes.front().as<IfcSchema::IfcRelAggregates>().RelatingObject();
|
||||
if (rel_obdef.as<IfcSchema::IfcElement>() && !rel_obdef.as<IfcSchema::IfcFeatureElementSubtraction>()) {
|
||||
express::Base rel_obdef;
|
||||
try {
|
||||
rel_obdef = decomposes.front().as<IfcSchema::IfcRelAggregates>().RelatingObject();
|
||||
} catch (const std::exception&) {
|
||||
// exception already logged as part of handling of placement
|
||||
break;
|
||||
}
|
||||
if (rel_obdef && rel_obdef.as<IfcSchema::IfcElement>() && !rel_obdef.as<IfcSchema::IfcFeatureElementSubtraction>()) {
|
||||
auto element = rel_obdef.as<IfcSchema::IfcElement>();
|
||||
auto rels = element.HasOpenings();
|
||||
for (auto& rel : rels) {
|
||||
|
||||
Reference in New Issue
Block a user