Skip to content

Commit

Permalink
Merge pull request #8282 from Roy-043/Arch-update-Arch.pruneIncluded-…
Browse files Browse the repository at this point in the history
…to-include-cloned-PD-Bodies

Arch: update Arch.pruneIncluded to include cloned PD Bodies
  • Loading branch information
yorikvanhavre committed Jan 31, 2023
2 parents fefa7cc + e10d92a commit c5c3077
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions src/Mod/Arch/ArchCommands.py
Expand Up @@ -729,27 +729,38 @@ def pruneIncluded(objectslist,strict=False):
for obj in objectslist:
toplevel = True
if obj.isDerivedFrom("Part::Feature"):
if not (Draft.getType(obj) in ["Window","Clone","Pipe","Rebar"]):
if Draft.getType(obj) not in ["Window","Clone","Pipe","Rebar"]:
for parent in obj.InList:
if parent.isDerivedFrom("Part::Feature") and not (Draft.getType(parent) in ["Space","Facebinder","Window","Roof","Clone","Site","Project"]):
if not parent.isDerivedFrom("Part::Part2DObject"):
# don't consider 2D objects based on arch elements
if hasattr(parent,"Host") and (parent.Host == obj):
pass
elif hasattr(parent,"Hosts") and (obj in parent.Hosts):
pass
elif hasattr(parent,"TypeId") and (parent.TypeId == "Part::Mirroring"):
pass
elif hasattr(parent,"CloneOf"):
if parent.CloneOf:
if parent.CloneOf.Name != obj.Name:
toplevel = False
else:
toplevel = False
else:
if not parent.isDerivedFrom("Part::Feature"):
pass
elif Draft.getType(parent) in ["Space","Facebinder","Window","Roof","Clone","Site","Project"]:
pass
elif parent.isDerivedFrom("Part::Part2DObject"):
# don't consider 2D objects based on arch elements
pass
elif parent.isDerivedFrom("PartDesign::FeatureBase"):
# don't consider a PartDesign_Clone that references obj
pass
elif parent.isDerivedFrom("PartDesign::Body") and obj == parent.BaseFeature:
# don't consider a PartDesign_Body with a PartDesign_Clone that references obj
pass
elif hasattr(parent,"Host") and parent.Host == obj:
pass
elif hasattr(parent,"Hosts") and obj in parent.Hosts:
pass
elif hasattr(parent,"TypeId") and parent.TypeId == "Part::Mirroring":
pass
elif hasattr(parent,"CloneOf"):
if parent.CloneOf:
if parent.CloneOf.Name != obj.Name:
toplevel = False
if (toplevel == False) and strict:
if not(parent in objectslist) and not(parent in newlist):
else:
toplevel = False
else:
toplevel = False

if toplevel == False and strict:
if parent not in objectslist and parent not in newlist:
toplevel = True
if toplevel:
newlist.append(obj)
Expand Down

0 comments on commit c5c3077

Please sign in to comment.