BIM: Fixed lock button with no doc - Fixes #18191

This commit is contained in:
Yorik van Havre
2024-12-03 15:30:03 +01:00
committed by Chris Hennes
parent faa5711016
commit d17dd22aff

View File

@@ -327,6 +327,8 @@ def unlock_document():
from nativeifc import ifc_tools # lazy loading
doc = FreeCAD.ActiveDocument
if not doc:
return
if "IfcFilePath" in doc.PropertiesList:
# this is a locked document
doc.openTransaction("Unlock document")
@@ -356,6 +358,8 @@ def lock_document():
from PySide import QtCore
doc = FreeCAD.ActiveDocument
if not doc:
return
products = []
spatial = []
ifcfile = None