diff --git a/src/Mod/Arch/ArchBuildingPart.py b/src/Mod/Arch/ArchBuildingPart.py index 837f87a36ff7..b74f99d42b23 100644 --- a/src/Mod/Arch/ArchBuildingPart.py +++ b/src/Mod/Arch/ArchBuildingPart.py @@ -334,6 +334,9 @@ def setProperties(self,obj): 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 @@ def onChanged(self,obj,prop): 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 @@ def touchChildren(self,obj): 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 c4530a5107b0..84a233736c3f 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -276,8 +276,9 @@ def getParentHeight(self,obj): 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"):