Add hooks so Gui classes can be seen by DXF importer

This commit is contained in:
Kevin Martin
2023-11-24 11:51:05 -05:00
committed by Yorik van Havre
parent aa1f75ef0e
commit 37e6c19a4b
6 changed files with 204 additions and 4 deletions

View File

@@ -2800,8 +2800,12 @@ def open(filename):
doc = FreeCAD.newDocument(docname)
doc.Label = docname
FreeCAD.setActiveDocument(doc.Name)
import Import
Import.readDXF(filename)
try:
import ImportGui
ImportGui.readDXF(filename)
except Exception:
import Import
Import.readDXF(filename)
Draft.convert_draft_texts() # convert annotations to Draft texts
doc.recompute()
@@ -2842,8 +2846,12 @@ def insert(filename, docname):
else:
errorDXFLib(gui)
else:
import Import
Import.readDXF(filename)
try:
import ImportGui
ImportGui.readDXF(filename)
except Exception:
import Import
Import.readDXF(filename)
Draft.convert_draft_texts() # convert annotations to Draft texts
doc.recompute()