Skip to content

Commit

Permalink
fixed conversion of new document
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Mar 19, 2024
1 parent a64871a commit 56c6627
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ifc_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def lock_document():
# 2 there is more than one project
FreeCAD.Console.PrintError("Unable to lock this document because it contains several IFC documents\n")
toggle_lock(False)
else:
# 3 there is no project
elif doc.Objects:
# 3 there is no project but objects
doc.openTransaction("Lock document")
ifc_tools.convert_document(doc, silent=True)
ifcfile = doc.Proxy.ifcfile
Expand All @@ -171,6 +171,9 @@ def lock_document():
ifc_tools.create_children(doc, ifcfile, recursive=True)
doc.commitTransaction()
doc.recompute()
else:
# 4 this is an empty document
ifc_tools.convert_document(doc, silent=True)


def find_toplevel(objs):
Expand Down

0 comments on commit 56c6627

Please sign in to comment.