Merge pull request #4076 from amrit3701/bug/importing_IFC_in_CLI_linked_with_FreeCADGui_module

[Arch] Fixed bug: Importing IFC in Console raises error because it linked with FreeCADGui module.
This commit is contained in:
Yorik van Havre
2020-12-01 16:00:51 +01:00
committed by GitHub

View File

@@ -1202,8 +1202,8 @@ 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:
objects = FreeCADGui.Selection.getSelection()
if not isinstance(objects,list):
objects = [objects]