From f0dd607cad838ccfebd5d29952f07a313c61782c Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Wed, 28 Jun 2023 11:04:57 +0200 Subject: [PATCH] Arch: Fixed error on null window preset creation parameters - fixes yorikvanhavre/BIM_Workbench#116 --- src/Mod/Arch/ArchWindowPresets.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Mod/Arch/ArchWindowPresets.py b/src/Mod/Arch/ArchWindowPresets.py index f61c7d31c2..c11ff1be03 100644 --- a/src/Mod/Arch/ArchWindowPresets.py +++ b/src/Mod/Arch/ArchWindowPresets.py @@ -51,6 +51,11 @@ def makeWindowPreset(windowtype,width,height,h1,h2,h3,w1,w2,o1,o2,placement=None w2 = float(w2) o1 = float(o1) o2 = float(o2) + # h1, h2, w1, w2 cannot be null (for now) + # TODO allow these to be null (don't create the component if so) + if not h1 or not h2 or not w1 or not w2: + FreeCAD.Console.PrintError("H1, H2, W1 and W2 parameters cannot be zero. Aborting\n") + return # small spacing to avoid wrong auto-wires in sketch tol = h1/10 # glass size divider