diff --git a/src/Mod/BIM/nativeifc/ifc_import.py b/src/Mod/BIM/nativeifc/ifc_import.py index 10ee53fb10..a09b741366 100644 --- a/src/Mod/BIM/nativeifc/ifc_import.py +++ b/src/Mod/BIM/nativeifc/ifc_import.py @@ -49,7 +49,7 @@ def open(filename): doc = FreeCAD.newDocument() doc.Label = name FreeCAD.setActiveDocument(doc.Name) - insert(filename, doc.Name, singledoc=True) + insert(filename, doc.Name, singledoc=None) del FreeCAD.IsOpeningIFC QtCore.QTimer.singleShot(100, unset_modified) return doc @@ -62,9 +62,13 @@ def insert( shapemode=None, switchwb=None, silent=False, - singledoc=None, + singledoc=False, ): - """Inserts an IFC document in a FreeCAD document""" + """Inserts an IFC document in a FreeCAD document. + Singledoc defines if the produced result is a locked document or not. The + strategy is: + - When opening IFC files, locked/unlocked depends on the preferences (default locked) + - When inserting IFC files, always unlocked (an IFC doc object is created)""" from PySide import QtCore # lazy loading @@ -78,7 +82,7 @@ def insert( except: document = FreeCAD.newDocument() if singledoc is None: - singledoc = PARAMS.GetBool("SingleDoc", False) + singledoc = PARAMS.GetBool("SingleDoc", True) if singledoc: prj_obj = ifc_tools.convert_document(document, filename, shapemode, strategy) QtCore.QTimer.singleShot(100, toggle_lock_on)