mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-01 20:49:44 +00:00
Fix find_openings for ifc2x3 #5639
This commit is contained in:
@@ -179,7 +179,12 @@ aggregate_of_instance::ptr mapping::find_openings(const IfcUtil::IfcBaseEntity*
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
auto decomposes = obdef->Decomposes()->generalize();
|
auto decomposes = obdef->Decomposes()->generalize();
|
||||||
if (decomposes->size() != 1) break;
|
if (decomposes->size() != 1) break;
|
||||||
IfcSchema::IfcObjectDefinition* rel_obdef = (*decomposes->begin())->as<IfcSchema::IfcRelAggregates>()->RelatingObject();
|
IfcSchema::IfcObjectDefinition* rel_obdef;
|
||||||
|
#ifdef SCHEMA_IfcRelDecomposes_HAS_RelatingObject
|
||||||
|
rel_obdef = (*decomposes->begin())->as<IfcSchema::IfcRelDecomposes>()->RelatingObject();
|
||||||
|
#else // IFC4+
|
||||||
|
rel_obdef = (*decomposes->begin())->as<IfcSchema::IfcRelAggregates>()->RelatingObject();
|
||||||
|
#endif
|
||||||
if (rel_obdef->as<IfcSchema::IfcElement>() && !rel_obdef->as<IfcSchema::IfcFeatureElementSubtraction>()) {
|
if (rel_obdef->as<IfcSchema::IfcElement>() && !rel_obdef->as<IfcSchema::IfcFeatureElementSubtraction>()) {
|
||||||
IfcSchema::IfcElement* element = rel_obdef->as<IfcSchema::IfcElement>();
|
IfcSchema::IfcElement* element = rel_obdef->as<IfcSchema::IfcElement>();
|
||||||
auto rels = element->HasOpenings();
|
auto rels = element->HasOpenings();
|
||||||
|
|||||||
Reference in New Issue
Block a user