From 2221820d79c809041cb06fff36ff98a5cd7177da Mon Sep 17 00:00:00 2001 From: paullee Date: Fri, 17 Aug 2018 07:26:31 +0800 Subject: [PATCH] Various general bugs fixes and _CommandStairs related --- src/Mod/Arch/ArchStairs.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Mod/Arch/ArchStairs.py b/src/Mod/Arch/ArchStairs.py index 06ce244d93..277fd82b48 100644 --- a/src/Mod/Arch/ArchStairs.py +++ b/src/Mod/Arch/ArchStairs.py @@ -108,11 +108,15 @@ class _CommandStairs: # a list of 'segment' / 'flight' of stairs stairs = [] additions = [] + lenSelection = len(FreeCADGui.Selection.getSelection()) - if len(FreeCADGui.Selection.getSelection()) > 0: - if len(FreeCADGui.Selection.getSelection()) > 1: + if lenSelection > 0: + if lenSelection > 1: stairs.append(makeStairs(None, None, None, None, None)) - i = 1 + i = 1 + else: + i = 0 + for obj in FreeCADGui.Selection.getSelection(): print (obj.Name) if (len(obj.Shape.Edges) > 1): @@ -120,17 +124,14 @@ class _CommandStairs: else: stairs.append(makeStairs(obj, None, None, None, 16)) if i > 1: - print(stairs[i].Name) additions.append(stairs[i]) - print(" i > 2 ") - print(stairs[i].Name) stairs[i].LastSegment = stairs[i-1] else: if len(stairs) > 1: # i.e. length >1, have a 'master' staircase created stairs[0].Base = stairs[i] i += 1 print(stairs) - if len(FreeCADGui.Selection.getSelection()) > 1: + if lenSelection > 1: stairs[0].Additions = additions else: