From 98dfa25def7253aa10e2f89a5647a6f83e53a722 Mon Sep 17 00:00:00 2001 From: paullee0 Date: Sun, 19 Jan 2020 03:54:53 +0800 Subject: [PATCH] [ArchWindow] getSubVolume() Bug - When HoleDepth is set but the Window is a Clone, no opening is created getSubVolume() - - When Windown is a Clone, no base is set - When HoleDepth is set, no further check if there is a Clone to set its base to Clone's base - The original code return None when no base is set --- src/Mod/Arch/ArchWindow.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Mod/Arch/ArchWindow.py b/src/Mod/Arch/ArchWindow.py index d5d7ab17cb..8433b41f06 100644 --- a/src/Mod/Arch/ArchWindow.py +++ b/src/Mod/Arch/ArchWindow.py @@ -1309,7 +1309,7 @@ class _Window(ArchComponent.Component): if obj.Base: base = obj.Base width = 0 - if hasattr(obj,"HoleDepth"): + if hasattr(obj,"HoleDepth"): # the code have not checked whether this is a clone and use the original's HoleDepth; if HoleDepth is set in this object, even it is a clone, the original's HoleDepth is overridden if obj.HoleDepth.Value: width = obj.HoleDepth.Value if not width: @@ -1317,13 +1317,14 @@ class _Window(ArchComponent.Component): b = base.Shape.BoundBox width = max(b.XLength,b.YLength,b.ZLength) if not width: - if Draft.isClone(obj,"Window"): + if Draft.isClone(obj,"Window"): # check whether this is a clone and use the original's HoleDepth or Shape's Boundbox if hasattr(obj,"CloneOf"): orig = obj.CloneOf else: orig = obj.Objects[0] if orig.Base: base = orig.Base + if hasattr(orig,"HoleDepth"): if orig.HoleDepth.Value: width = orig.HoleDepth.Value @@ -1333,8 +1334,17 @@ class _Window(ArchComponent.Component): width = max(b.XLength,b.YLength,b.ZLength) if not width: width = 1.1112 # some weird value to have little chance to overlap with an existing face + if not base: - return None + if Draft.isClone(obj,"Window"): # if this object has not base, check whether this is a clone and use the original's base + if hasattr(obj,"CloneOf"): + orig = obj.CloneOf + else: + orig = obj.Objects[0] # not sure what is this exactly + if orig.Base: + base = orig.Base + else: + return None # finding which wire to use to drill the hole