From 9be061635cc53a98b65245cf31c83a0c3edd2f65 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 26 Mar 2018 13:11:38 -0300 Subject: [PATCH] Arch: Fixed adding/removing of windows in walls --- src/Mod/Arch/ArchCommands.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 5b6f8e3ce5..ff546472c6 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -103,7 +103,13 @@ def addComponents(objectsList,host): x = host.Axes for o in objectsList: if o.isDerivedFrom("Part::Feature"): - if DraftGeomUtils.isValidPath(o.Shape) and (hostType == "Structure"): + if Draft.getType(o) == "Window": + if hasattr(o,"Hosts"): + if not host in o.Hosts: + g = o.Hosts + g.append(host) + o.Hosts = g + elif DraftGeomUtils.isValidPath(o.Shape) and (hostType == "Structure"): if o.Support == host: o.Support = None host.Tool = o @@ -146,7 +152,13 @@ def removeComponents(objectsList,host=None): objectsList.remove(o) s = host.Subtractions for o in objectsList: - if not o in s: + if Draft.getType(o) == "Window": + if hasattr(o,"Hosts"): + if not host in o.Hosts: + g = o.Hosts + g.append(host) + o.Hosts = g + elif not o in s: s.append(o) if FreeCAD.GuiUp: if not Draft.getType(o) in ["Window","Roof"]: