mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 05:46:51 +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):
|
for representation in tool.Geometry.get_representations_iter(element):
|
||||||
representation_type = representation.RepresentationType
|
representation_type = representation.RepresentationType
|
||||||
if representation_type == "MappedRepresentation":
|
resolved_representation = ifcopenshell.util.representation.resolve_representation(representation)
|
||||||
representation_type = representation.Items[0].MappingSource.MappedRepresentation.RepresentationType
|
|
||||||
representation_type += "*"
|
if resolved_representation != representation:
|
||||||
|
representation_type = resolved_representation.RepresentationType + "*"
|
||||||
|
|
||||||
|
is_active = (
|
||||||
|
representation.id() == active_representation_id
|
||||||
|
or resolved_representation.id() == active_representation_id
|
||||||
|
)
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"id": representation.id(),
|
"id": representation.id(),
|
||||||
"ContextType": representation.ContextOfItems.ContextType or "",
|
"ContextType": representation.ContextOfItems.ContextType or "",
|
||||||
"ContextIdentifier": "",
|
"ContextIdentifier": "",
|
||||||
"TargetView": "",
|
"TargetView": "",
|
||||||
"RepresentationType": representation_type or "",
|
"RepresentationType": representation_type or "",
|
||||||
"is_active": representation.id() == active_representation_id,
|
"is_active": is_active,
|
||||||
}
|
}
|
||||||
if representation.ContextOfItems.is_a("IfcGeometricRepresentationSubContext"):
|
if representation.ContextOfItems.is_a("IfcGeometricRepresentationSubContext"):
|
||||||
data["ContextIdentifier"] = representation.ContextOfItems.ContextIdentifier or ""
|
data["ContextIdentifier"] = representation.ContextOfItems.ContextIdentifier or ""
|
||||||
|
|||||||
Reference in New Issue
Block a user