From ffd944f4f9de287f7c12ded554abe260e44778c2 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 12 Jun 2024 13:53:52 +0500 Subject: [PATCH] style->instance_id to consider possible IfcPresentationStyleAssignment in ifc2x3/ifc4 --- src/ifcwrap/IfcGeomWrapper.i | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index ea4d637356..fe08541a6f 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -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(); + // < IFC4X3. + if (ent->declaration().name() == "IfcPresentationStyleAssignment") { + aggregate_of_instance::ptr styles = *ent->get("Styles"); + if (styles->size() == 1) { + ent = (*styles->begin())->as(); + } else { + return 0; + } + } } else { return 0; }