#1078 check optional opening attributes

This commit is contained in:
Thomas Krijnen
2020-11-05 13:37:21 +01:00
parent ba09e08da5
commit f5c57d2a1c
+2
View File
@@ -1736,10 +1736,12 @@ IfcSchema::IfcRelVoidsElement::list::ptr IfcGeom::Kernel::find_openings(IfcSchem
// Filter openings in Reference view, solely marked as Reference. // Filter openings in Reference view, solely marked as Reference.
IfcSchema::IfcRelVoidsElement::list::ptr openings(new IfcSchema::IfcRelVoidsElement::list); IfcSchema::IfcRelVoidsElement::list::ptr openings(new IfcSchema::IfcRelVoidsElement::list);
std::for_each(rs.begin(), rs.end(), [&openings](IfcSchema::IfcRelVoidsElement* rel) { std::for_each(rs.begin(), rs.end(), [&openings](IfcSchema::IfcRelVoidsElement* rel) {
if (rel->RelatedOpeningElement()->hasObjectPlacement() && rel->RelatedOpeningElement()->hasRepresentation()) {
auto reps = rel->RelatedOpeningElement()->Representation()->Representations(); auto reps = rel->RelatedOpeningElement()->Representation()->Representations();
if (!(reps->size() == 1 && (*reps->begin())->RepresentationIdentifier() == "Reference")) { if (!(reps->size() == 1 && (*reps->begin())->RepresentationIdentifier() == "Reference")) {
openings->push(rel); openings->push(rel);
} }
}
}); });
return openings; return openings;