From 8814d3a22b386cde200f268f1b8afc3e3b1ba64e Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 26 Sep 2024 12:12:11 +0500 Subject: [PATCH] Lock all representation items that are not movable Otherwise it was confusing that user can move item but when they exit item mode position was lost --- src/bonsai/bonsai/bim/module/geometry/operator.py | 2 +- src/bonsai/bonsai/tool/geometry.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/module/geometry/operator.py b/src/bonsai/bonsai/bim/module/geometry/operator.py index d16e3a23e9..d03290f7bd 100644 --- a/src/bonsai/bonsai/bim/module/geometry/operator.py +++ b/src/bonsai/bonsai/bim/module/geometry/operator.py @@ -2357,7 +2357,7 @@ class ImportRepresentationItems(bpy.types.Operator, tool.Ifc.Operator): tool.Geometry.import_item(item_obj) tool.Geometry.import_item_attributes(item_obj) - if tool.Geometry.is_meshlike_item(item): + if not tool.Geometry.is_movable(item): tool.Geometry.lock_object(item_obj) tool.Root.reload_item_decorator() diff --git a/src/bonsai/bonsai/tool/geometry.py b/src/bonsai/bonsai/tool/geometry.py index cd17d025a5..d3c569a891 100644 --- a/src/bonsai/bonsai/tool/geometry.py +++ b/src/bonsai/bonsai/tool/geometry.py @@ -842,6 +842,10 @@ class Geometry(bonsai.core.tool.Geometry): def is_meshlike_item(cls, item: ifcopenshell.entity_instance) -> bool: return item.is_a("IfcTessellatedItem") or item.is_a("IfcManifoldSolidBrep") + @classmethod + def is_movable(cls, item: ifcopenshell.entity_instance) -> bool: + return item.is_a("IfcSweptAreaSolid") + @classmethod def is_profile_based(cls, data: bpy.types.Mesh) -> bool: return data.BIMMeshProperties.subshape_type == "PROFILE"