Fix UI bug with active representation indication for occurrences (#7009)

This commit is contained in:
falken10vdl
2025-08-15 15:36:15 +02:00
committed by GitHub
parent 1fcf2fb53f
commit b024ba05da
+11 -4
View File
@@ -117,16 +117,23 @@ class RepresentationsData:
for representation in tool.Geometry.get_representations_iter(element):
representation_type = representation.RepresentationType
if representation_type == "MappedRepresentation":
representation_type = representation.Items[0].MappingSource.MappedRepresentation.RepresentationType
representation_type += "*"
resolved_representation = ifcopenshell.util.representation.resolve_representation(representation)
if resolved_representation != representation:
representation_type = resolved_representation.RepresentationType + "*"
is_active = (
representation.id() == active_representation_id
or resolved_representation.id() == active_representation_id
)
data = {
"id": representation.id(),
"ContextType": representation.ContextOfItems.ContextType or "",
"ContextIdentifier": "",
"TargetView": "",
"RepresentationType": representation_type or "",
"is_active": representation.id() == active_representation_id,
"is_active": is_active,
}
if representation.ContextOfItems.is_a("IfcGeometricRepresentationSubContext"):
data["ContextIdentifier"] = representation.ContextOfItems.ContextIdentifier or ""