From f45dddd7aaeab6b0d6bce897bfddd52d693928f9 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Wed, 19 Oct 2016 18:17:57 -0200 Subject: [PATCH] Arch: fixed bug in schedule generation --- src/Mod/Arch/ArchCommands.py | 10 +++++++--- src/Mod/Arch/ArchSchedule.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 721bd1f9ce..caf803a210 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -662,9 +662,10 @@ def getHost(obj,strict=True): return par return None -def pruneIncluded(objectslist): - """pruneIncluded(objectslist): removes from a list of Arch objects, those that are subcomponents of - another shape-based object, leaving only the top-level shapes.""" +def pruneIncluded(objectslist,strict=False): + """pruneIncluded(objectslist,[strict]): removes from a list of Arch objects, those that are subcomponents of + another shape-based object, leaving only the top-level shapes. If strict is True, the object + is removed only if the parent is also part of the selection.""" import Draft newlist = [] for obj in objectslist: @@ -683,6 +684,9 @@ def pruneIncluded(objectslist): toplevel = False else: toplevel = False + if (toplevel == False) and strict: + if not(parent in objectslist) and not(parent in newlist): + toplevel = True if toplevel: newlist.append(obj) return newlist diff --git a/src/Mod/Arch/ArchSchedule.py b/src/Mod/Arch/ArchSchedule.py index 41ad911053..dd71aea5e3 100644 --- a/src/Mod/Arch/ArchSchedule.py +++ b/src/Mod/Arch/ArchSchedule.py @@ -119,7 +119,7 @@ class _ArchSchedule: if objs[0].isDerivedFrom("App::DocumentObjectGroup"): objs = objs[0].Group objs = Draft.getGroupContents(objs,walls=True,addgroups=True) - objs = Arch.pruneIncluded(objs) + objs = Arch.pruneIncluded(objs,strict=True) if obj.Filter[i]: # apply filters nobjs = []