From b4ee9b62aed37a9a8128b394ddd11f880bb3a335 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 16 May 2022 09:34:14 +0200 Subject: [PATCH] Arch: Fixed default component type for new windows --- src/Mod/Arch/ArchWindow.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Mod/Arch/ArchWindow.py b/src/Mod/Arch/ArchWindow.py index 56799c8db9..21cd99c3c5 100644 --- a/src/Mod/Arch/ArchWindow.py +++ b/src/Mod/Arch/ArchWindow.py @@ -96,7 +96,11 @@ def makeWindow(baseobj=None,width=None,height=None,parts=None,name=None): else: if baseobj: if baseobj.getLinkedObject().isDerivedFrom("Part::Part2DObject"): + # create default component if baseobj.Shape.Wires: + tp = "Frame" + if len(baseobj.Shape.Wires) == 1: + tp = "Panel" i = 0 ws = '' for w in baseobj.Shape.Wires: @@ -104,7 +108,7 @@ def makeWindow(baseobj=None,width=None,height=None,parts=None,name=None): if ws: ws += "," ws += "Wire" + str(i) i += 1 - obj.WindowParts = ["Default","Frame",ws,"1","0"] + obj.WindowParts = ["Default",tp,ws,"1","0"] else: # bind properties from base obj if existing for prop in ["Height","Width","Subvolume","Tag","Description","Material"]: