mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fix linked drawings hidden on drawing activation
Link empty handles were missing from visible_objects, so linked models were always hidden when activating a drawing. Generated with the assistance of an AI coding tool.
This commit is contained in:
@@ -2577,10 +2577,19 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
has_context = True
|
||||
break
|
||||
|
||||
linked_handles: set[bpy.types.Object] = set()
|
||||
for link in tool.Project.get_project_props().get_loaded_links_for_drawings():
|
||||
try:
|
||||
handle = tool.Project.get_link_empty_handle(link)
|
||||
except Exception:
|
||||
continue
|
||||
if handle:
|
||||
linked_handles.add(handle)
|
||||
|
||||
visible_objects = []
|
||||
for obj in bpy.context.view_layer.objects:
|
||||
if element := tool.Ifc.get_entity(obj):
|
||||
if element in filtered_elements:
|
||||
if element in filtered_elements or obj in linked_handles:
|
||||
visible_objects.append(obj)
|
||||
else:
|
||||
if obj.hide_get() is False:
|
||||
|
||||
Reference in New Issue
Block a user