From 8c6f77bb2b2b4ef3202d4fa2f3469539c17a2462 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 2 Jul 2013 14:52:32 +0200 Subject: [PATCH] Fix weird behaviour for 64-bit version on Windows --- src/App/Document.cpp | 4 ++-- src/Mod/Part/Init.py | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 8454df3ea..ee92e46da 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -803,8 +803,8 @@ Document::readObjects(Base::XMLReader& reader) reader.addName(name.c_str(), obj->getNameInDocument()); } } - catch (Base::Exception&) { - Base::Console().Message("Cannot create object '%s'\n", name.c_str()); + catch (const Base::Exception& e) { + Base::Console().Error("Cannot create object '%s': (%s)\n", name.c_str(), e.what()); } } reader.readEndElement("Objects"); diff --git a/src/Mod/Part/Init.py b/src/Mod/Part/Init.py index b81a441b4..6423a47ae 100644 --- a/src/Mod/Part/Init.py +++ b/src/Mod/Part/Init.py @@ -51,3 +51,11 @@ FreeCAD.addImportType("IGES format (*.iges *.igs)","Part") FreeCAD.addExportType("IGES format (*.iges *.igs)","Part") FreeCAD.addImportType("STEP with colors (*.step *.stp)","ImportGui") FreeCAD.addExportType("STEP with colors (*.step *.stp)","ImportGui") + +# weird behaviour as 64-bit application on Windows: +# some modules like Sketcher doesn't load if Part is not loaded before with this error: +# DLL load failed: The specified procedure could not be found +import platform +if platform.architecture()[0] == '64bit' and platform.system() == 'Windows': + import Part +