From 2bc0826c7776025a0ad4fd2c62543ab3de1391fb Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 4 Aug 2015 22:18:30 -0300 Subject: [PATCH] Arch: Reintroduced support for custom subvolumes for windows --- src/Mod/Arch/ArchComponent.py | 3 +++ src/Mod/Arch/ArchWindow.py | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index 1ea8a526c..766e911a3 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -754,6 +754,9 @@ class ViewProviderComponent: if hasattr(self.Object,"Tool"): if self.Object.Tool: c.append(self.Object.Tool) + if hasattr(self.Object,"Subvolume"): + if self.Object.Subvolume: + c.append(self.Object.Subvolume) return c return [] diff --git a/src/Mod/Arch/ArchWindow.py b/src/Mod/Arch/ArchWindow.py index 57e17cb15..1d642d2f6 100644 --- a/src/Mod/Arch/ArchWindow.py +++ b/src/Mod/Arch/ArchWindow.py @@ -599,8 +599,7 @@ class _Window(ArchComponent.Component): ArchComponent.Component.__init__(self,obj) obj.addProperty("App::PropertyStringList","WindowParts","Arch",translate("Arch","the components of this window")) obj.addProperty("App::PropertyLength","HoleDepth","Arch",translate("Arch","The depth of the hole that this window makes in its host object. Keep 0 for automatic.")) - # the following line creates problem when restoring saved files (wrongly attributes it to the window shape). Disabling for now... - #obj.addProperty("Part::PropertyPartShape","Subvolume","Arch",translate("Arch","an optional volume to be subtracted from hosts of this window")) + obj.addProperty("App::PropertyLink","Subvolume","Arch",translate("Arch","an optional object that defines a volume to be subtracted from hosts of this window")) obj.addProperty("App::PropertyLength","Width","Arch",translate("Arch","The width of this window (for preset windows only)")) obj.addProperty("App::PropertyLength","Height","Arch",translate("Arch","The height of this window (for preset windows only)")) obj.addProperty("App::PropertyVector","Normal","Arch",translate("Arch","The normal direction of this window")) @@ -707,8 +706,12 @@ class _Window(ArchComponent.Component): # check if we have a custom subvolume if hasattr(obj,"Subvolume"): if obj.Subvolume: - if not obj.Subvolume.isNull(): - return obj.Subvolume + if obj.Subvolume.isDerivedFrom("Part::Feature"): + if not obj.Subvolume.Shape.isNull(): + sh = obj.Subvolume.Shape.copy() + if plac: + sh.Placement = plac + return sh # getting extrusion depth base = None