Arch: fixed bug in schedule generation

This commit is contained in:
Yorik van Havre 2016-10-19 18:17:57 -02:00
parent fff123c474
commit dca8fd7334
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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 = []