From 517f14b90e5352add4073db5ac0d095e532b97c6 Mon Sep 17 00:00:00 2001 From: Amritpal Singh Date: Mon, 23 Nov 2020 18:19:20 +0530 Subject: [PATCH 1/2] Fixed bug: Importing IFC in Console raises error because it linked with FreeeCADGui module. --- src/Mod/Arch/ArchCommands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 2d3afdbdac..263f930a86 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -1202,8 +1202,9 @@ def cleanArchSplitter(objects=None): def rebuildArchShape(objects=None): """rebuildArchShape([objects]): takes the faces from the base shape of the given (or selected if objects is None) Arch objects, and tries to rebuild a valid solid from them.""" - import FreeCAD,FreeCADGui,Part - if not objects: + import FreeCAD,Part + if not objects and FreeCAD.GuiUp: + import FreeCADGui objects = FreeCADGui.Selection.getSelection() if not isinstance(objects,list): objects = [objects] From 4ddade87dd10f43042b091f4baafece60b52b786 Mon Sep 17 00:00:00 2001 From: Amritpal Singh Date: Tue, 24 Nov 2020 15:16:43 +0530 Subject: [PATCH 2/2] Removed multiple import of FreeCADGui in rebuildArchShape. --- src/Mod/Arch/ArchCommands.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 263f930a86..daba56a160 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -1204,7 +1204,6 @@ def rebuildArchShape(objects=None): if objects is None) Arch objects, and tries to rebuild a valid solid from them.""" import FreeCAD,Part if not objects and FreeCAD.GuiUp: - import FreeCADGui objects = FreeCADGui.Selection.getSelection() if not isinstance(objects,list): objects = [objects]