diff --git a/src/serializers/schema_dependent/XmlSerializer.cpp b/src/serializers/schema_dependent/XmlSerializer.cpp index 508c6e6060..5f3c3ccf70 100644 --- a/src/serializers/schema_dependent/XmlSerializer.cpp +++ b/src/serializers/schema_dependent/XmlSerializer.cpp @@ -219,9 +219,9 @@ ptree* descend(ifcopenshell::geometry::abstract_mapping* mapping, A* instance, p // Returns related entity instances using IFC's objectified relationship // model. The second and third argument require a member function pointer. template -typename V::list::ptr get_related(T* t, F f, G g) { +auto get_related(T* t, F f, G g) { typename U::list::ptr li = (*t.*f)()->template as(); - typename V::list::ptr acc(new typename V::list); + typename aggregate_of::ptr acc(new aggregate_of); for (typename U::list::it it = li->begin(); it != li->end(); ++it) { U* u = *it; try { @@ -305,6 +305,14 @@ ptree* descend(ifcopenshell::geometry::abstract_mapping* mapping, IfcSchema::Ifc (object, &IfcSchema::IfcObject::IsDefinedBy, &IfcSchema::IfcRelDefinesByProperties::RelatingPropertyDefinition); + aggregate_of::ptr property_set_sets = get_related + + (object, &IfcSchema::IfcObject::IsDefinedBy, &IfcSchema::IfcRelDefinesByProperties::RelatingPropertyDefinition); + + for (auto& s : *property_set_sets) { + property_sets->push((decltype(property_sets))*s); + } + for (IfcSchema::IfcPropertySetDefinition::list::it it = property_sets->begin(); it != property_sets->end(); ++it) { IfcSchema::IfcPropertySetDefinition* pset = *it; if (pset->declaration().is(IfcSchema::IfcPropertySet::Class())) {