style->instance_id to consider possible IfcPresentationStyleAssignment in ifc2x3/ifc4

This commit is contained in:
Andrej730
2024-06-12 13:53:52 +05:00
committed by Thomas Krijnen
parent ecef745c3b
commit ffd944f4f9
+9
View File
@@ -213,6 +213,15 @@ std::string taxonomy_item_repr(ifcopenshell::geometry::taxonomy::item::ptr i) {
aggregate_of_instance::ptr styles = *ent->get("Styles");
if (styles->size() == 1) {
ent = (*styles->begin())->as<IfcUtil::IfcBaseEntity>();
// < IFC4X3.
if (ent->declaration().name() == "IfcPresentationStyleAssignment") {
aggregate_of_instance::ptr styles = *ent->get("Styles");
if (styles->size() == 1) {
ent = (*styles->begin())->as<IfcUtil::IfcBaseEntity>();
} else {
return 0;
}
}
} else {
return 0;
}