mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-06 20:36:27 +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.
|
// Only aggregation, not nesting is considered.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
auto rel_obdef = decomposes.front().as<IfcSchema::IfcRelAggregates>().RelatingObject();
|
express::Base rel_obdef;
|
||||||
if (rel_obdef.as<IfcSchema::IfcElement>() && !rel_obdef.as<IfcSchema::IfcFeatureElementSubtraction>()) {
|
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 element = rel_obdef.as<IfcSchema::IfcElement>();
|
||||||
auto rels = element.HasOpenings();
|
auto rels = element.HasOpenings();
|
||||||
for (auto& rel : rels) {
|
for (auto& rel : rels) {
|
||||||
|
|||||||
Reference in New Issue
Block a user