From 966a04e053f6dcfa5f0024dbf6775f35c7a9f730 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 24 Aug 2023 15:20:36 +0500 Subject: [PATCH] Update currently selected ifc class and type on selecting object Had this idea for awhile now and heard it multiple times from other people. Please give feedback if this feature gets in the way instead of helping. Example - https://imgur.com/a/K4hz2FB --- src/blenderbim/blenderbim/bim/handler.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/bim/handler.py b/src/blenderbim/blenderbim/bim/handler.py index 2d1cfad4c5..502718bb1d 100644 --- a/src/blenderbim/blenderbim/bim/handler.py +++ b/src/blenderbim/blenderbim/bim/handler.py @@ -124,6 +124,14 @@ def update_bim_tool_props(): representation = ifcopenshell.util.representation.get_representation(element, "Model", "Body", "MODEL_VIEW") if not representation: return + + props = bpy.context.scene.BIMModelProperties + if element.is_a("IfcElementType") or element.is_a("IfcElement"): + element_type = ifcopenshell.util.element.get_type(element) + if element_type: + props.ifc_class = element_type.is_a() + props.relating_type_id = str(element_type.id() +) extrusion = tool.Model.get_extrusion(representation) if not extrusion: return @@ -134,7 +142,6 @@ def update_bim_tool_props(): return x_angle si_conversion = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get()) - props = bpy.context.scene.BIMModelProperties if not AuthoringData.is_loaded: AuthoringData.load()