From bcbabe72c9694262f1c1e81d139db6ee6b446775 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Fri, 5 Feb 2016 19:05:15 -0200 Subject: [PATCH] Arch: Fixed missing views of windows --- src/Mod/Draft/Draft.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 0085c2ea40..6db75ad6a4 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -311,6 +311,15 @@ def getGroupContents(objectslist,walls=False,addgroups=False): is a group, its content is appened to the list, which is returned. If walls is True, walls are also scanned for included windows. If addgroups is true, the group itself is also included in the list.''' + def getWindows(obj): + l = [] + if getType(obj) in ["Wall","Structure"]: + for o in obj.OutList: + l.extend(getWindows(o)) + elif (getType(obj) == "Window") or isClone(obj,"Window"): + l.append(obj) + return l + newlist = [] if not isinstance(objectslist,list): objectslist = [objectslist] @@ -327,10 +336,8 @@ def getGroupContents(objectslist,walls=False,addgroups=False): #print("adding ",obj.Name) newlist.append(obj) if walls: - if getType(obj) in ["Wall","Structure"]: - for o in obj.OutList: - if (getType(o) == "Window") or isClone(o,"Window"): - newlist.append(o) + newlist.extend(getWindows(obj)) + # cleaning possible duplicates cleanlist = [] for obj in newlist: