From 3fc219a8249b054cc64938079b4fb9b989bfcb23 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Sun, 1 Jun 2025 11:52:28 +0200 Subject: [PATCH] BIM: Terrain should not also be in Group of Site Addresses one of the issues mentioned in #21667. * If the Terrain is dropped on the Site it is added to the Group (as before) but the Terrain property is then also set to None. * If one of the objects in Group is selected as the Terrain it is removed from the Group. --- src/Mod/BIM/ArchSite.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Mod/BIM/ArchSite.py b/src/Mod/BIM/ArchSite.py index 2fdf971929..b1ff111b0a 100644 --- a/src/Mod/BIM/ArchSite.py +++ b/src/Mod/BIM/ArchSite.py @@ -659,8 +659,15 @@ class _Site(ArchIFC.IfcProduct): def onChanged(self, obj, prop): ArchComponent.Component.onChanged(self, obj, prop) - if prop == "Terrain" and obj.Terrain and FreeCAD.GuiUp: - obj.Terrain.ViewObject.hide() + if prop == "Terrain" and obj.Terrain: + if obj.Terrain in getattr(obj,"Group",[]): + grp = obj.Group + grp.remove(obj.Terrain) + obj.Group = grp + if FreeCAD.GuiUp: + obj.Terrain.ViewObject.hide() + if prop == "Group" and getattr(obj,"Terrain",None) in obj.Group: + obj.Terrain = None def getMovableChildren(self, obj): return obj.Additions + obj.Subtractions