From 9316de659dab422959e56481f3115ac3d77126a0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 2 Oct 2012 13:01:16 +0200 Subject: [PATCH] Use STEP AP203 for 64-bit due to a bug in OCC --- src/Mod/Part/App/AppPart.cpp | 11 +++++++++++ src/Mod/Part/Init.py | 15 ++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index c52c467cf..6bcc48860 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -92,6 +92,17 @@ void PartExport initPart() str << OCC_VERSION_MAJOR << "." << OCC_VERSION_MINOR << "." << OCC_VERSION_MAINTENANCE; App::Application::Config()["OCC_VERSION"] = str.str(); + // see Init.py +#if defined (_OCC64) +#if OCC_VERSION_HEX < 0x060503 + App::GetApplication().addImportType("STEP AP203 format (*.step *.stp)","Part"); + App::GetApplication().addExportType("STEP AP203 format (*.step *.stp)","Part"); +#else + App::GetApplication().addImportType("STEP AP214 format (*.step *.stp)","ImportGui"); + App::GetApplication().addExportType("STEP AP214 format (*.step *.stp)","ImportGui"); +#endif +#endif + PyObject* partModule = Py_InitModule3("Part", Part_methods, module_part_doc); /* mod name, table ptr */ Base::Console().Log("Loading Part module... done\n"); diff --git a/src/Mod/Part/Init.py b/src/Mod/Part/Init.py index fcd75f94c..33a81998e 100644 --- a/src/Mod/Part/Init.py +++ b/src/Mod/Part/Init.py @@ -50,12 +50,13 @@ FreeCAD.addExportType("BREP format (*.brep *.brp)","Part") FreeCAD.addImportType("IGES format (*.iges *.igs)","Part") FreeCAD.addExportType("IGES format (*.iges *.igs)","Part") -# There is a bug in OCC 6.5.3 (and older which leads to a crash) +# There is a bug in OCC 6.5.0 64-bit and older which leads to a crash +# The registration of the STEP filetype for 64-bit is handled in initPart() import platform -if platform.architecture()[0]=='64bit': - FreeCAD.addImportType("STEP AP203 format (*.step *.stp)","Part") - FreeCAD.addExportType("STEP AP203 format (*.step *.stp)","Part") -else: - FreeCAD.addImportType("STEP AP214 format (*.step *.stp)","ImportGui") - FreeCAD.addExportType("STEP AP214 format (*.step *.stp)","ImportGui") +if platform.architecture()[0]=='32bit': + FreeCAD.addImportType("STEP AP214 format (*.step *.stp)","ImportGui") + FreeCAD.addExportType("STEP AP214 format (*.step *.stp)","ImportGui") +#else: +# FreeCAD.addImportType("STEP AP203 format (*.step *.stp)","Part") +# FreeCAD.addExportType("STEP AP203 format (*.step *.stp)","Part")