mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Fix UI bug with active representation indication for occurrences (#7009)
This commit is contained in:
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user