From 17b00b3acacb10698cb93bec7de8bd83b618b60c Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 1 Oct 2018 18:36:29 -0300 Subject: [PATCH] Arch: bugfixes in reference tool --- src/Mod/Arch/ArchBuildingPart.py | 14 ++++++++++---- src/Mod/Arch/ArchReference.py | 8 +++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Mod/Arch/ArchBuildingPart.py b/src/Mod/Arch/ArchBuildingPart.py index 06efa842a4..9d3a8f8b90 100644 --- a/src/Mod/Arch/ArchBuildingPart.py +++ b/src/Mod/Arch/ArchBuildingPart.py @@ -406,12 +406,18 @@ class BuildingPart: "recursively get the shapes of objects inside this BuildingPart" shapes = [] + if obj.isDerivedFrom("Part::Feature") and obj.Shape and (not obj.Shape.isNull()): + shapes.append(obj.Shape) if hasattr(obj,"Group"): for child in obj.Group: - if child.isDerivedFrom("Part::Feature") and child.Shape and (not child.Shape.isNull()): - shapes.append(child.Shape) - elif hasattr(child,"Group"): - shapes.extend(self.getShapes(child)) + shapes.extend(self.getShapes(child)) + for i in obj.InList: + if hasattr(i,"Hosts"): + if obj in i.Hosts: + shapes.extend(self.getShapes(i)) + elif hasattr(i,"Host"): + if obj == i.Host: + shapes.extend(self.getShapes(i)) return shapes def getSpaces(self,obj): diff --git a/src/Mod/Arch/ArchReference.py b/src/Mod/Arch/ArchReference.py index ec1947bc24..8e3d338eb1 100644 --- a/src/Mod/Arch/ArchReference.py +++ b/src/Mod/Arch/ArchReference.py @@ -96,6 +96,7 @@ class ArchReference: def onDocumentRestored(self,obj): ArchReference.setProperties(self,obj) + self.reload = False def __getstate__(self): @@ -244,10 +245,11 @@ class ViewProviderArchReference: self.Object.touch() self.Object.ViewObject.TimeStamp = st_mtime - def onDelete(self): + def onDelete(self,obj,doc): - self.timer.stop() - del self.timer + if hasattr(self,"timer"): + self.timer.stop() + del self.timer def setupContextMenu(self,vobj,menu):