From 1b212feffbe7c8203670cb147403e1ee464dfcb5 Mon Sep 17 00:00:00 2001 From: Francesco Fantoni Date: Sat, 12 Oct 2019 09:05:58 +0200 Subject: [PATCH] [Arch] suggested feature: add the ability to choose whether an Arch BuildingPart transmits its height value to children --- src/Mod/Arch/ArchBuildingPart.py | 7 +++++-- src/Mod/Arch/ArchComponent.py | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Mod/Arch/ArchBuildingPart.py b/src/Mod/Arch/ArchBuildingPart.py index 837f87a36f..b74f99d42b 100644 --- a/src/Mod/Arch/ArchBuildingPart.py +++ b/src/Mod/Arch/ArchBuildingPart.py @@ -334,6 +334,9 @@ class BuildingPart(ArchIFC.IfcProduct): pl = obj.PropertiesList if not "Height" in pl: obj.addProperty("App::PropertyLength","Height","BuildingPart",QT_TRANSLATE_NOOP("App::Property","The height of this object")) + if not "HeightPropagate" in pl: + obj.addProperty("App::PropertyBool","HeightPropagate","Children",QT_TRANSLATE_NOOP("App::Property","If true, the height value propagates to contained objects")) + obj.HeightPropagate = True if not "LevelOffset" in pl: obj.addProperty("App::PropertyLength","LevelOffset","BuildingPart",QT_TRANSLATE_NOOP("App::Property","The level of the (0,0,0) point of this level")) if not "Area" in pl: @@ -376,7 +379,7 @@ class BuildingPart(ArchIFC.IfcProduct): self.svgcache = None self.shapecache = None - if (prop == "Height") and obj.Height.Value: + if (prop == "Height" or prop == "HeightPropagate") and obj.Height.Value: self.touchChildren(obj) elif prop == "Placement": @@ -466,7 +469,7 @@ class BuildingPart(ArchIFC.IfcProduct): if not child.Height.Value: print("Executing ",child.Label) child.Proxy.execute(child) - elif Draft.getType(child) in ["Group"]: + elif Draft.getType(child) in ["Group","BuildingPart"]: self.touchChildren(child) diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index c4530a5107..84a233736c 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -276,8 +276,9 @@ class Component(ArchIFC.IfcProduct): for parent in obj.InList: if Draft.getType(parent) in ["Floor","BuildingPart"]: if obj in parent.Group: - if parent.Height.Value: - return parent.Height.Value + if parent.HeightPropagate: + if parent.Height.Value: + return parent.Height.Value # not found? get one level higher for parent in obj.InList: if hasattr(parent,"Group"):