From 514cbb49cc9d6d21d36c58ef545ca5e1f82dfb03 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Sun, 22 Feb 2026 17:46:10 -0600 Subject: [PATCH] Fix #7646: Fix layer thumbnail orientation for IFC types Use EPset_Parametric.LayerSetDirection exclusively to determine horizontal vs vertical layer rendering in type thumbnails, rather than hardcoding IfcSlabType checks. Also fix line drawing to use the is_horizontal flag consistently. Generated with the assistance of an AI coding tool. --- src/bonsai/bonsai/tool/model.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/bonsai/bonsai/tool/model.py b/src/bonsai/bonsai/tool/model.py index 148f4a6b75..c9cca803ec 100644 --- a/src/bonsai/bonsai/tool/model.py +++ b/src/bonsai/bonsai/tool/model.py @@ -1245,9 +1245,6 @@ class Model(bonsai.core.tool.Model): height = 100 is_horizontal = False - if element.is_a("IfcSlabType"): - is_horizontal = True - parametric = ifcopenshell.util.element.get_psets(element).get("EPset_Parametric") if parametric: layer_set_direction = parametric.get("LayerSetDirection", None) @@ -1266,7 +1263,7 @@ class Model(bonsai.core.tool.Model): del thicknesses[-1] for thickness in thicknesses: current_thickness += thickness - if element.is_a("IfcSlabType"): + if is_horizontal: y = (current_thickness / total_thickness) * height line = [x_offset, y_offset + y, x_offset + width, y_offset + y] else: