Use STEP AP203 for 64-bit due to a bug in OCC
This commit is contained in:
parent
95de7d19cf
commit
a5d9ee4be9
|
@ -446,19 +446,20 @@ CmdPartImport::CmdPartImport()
|
|||
void CmdPartImport::activated(int iMsg)
|
||||
{
|
||||
QStringList filter;
|
||||
filter << QObject::tr("STEP AP203 (*.stp *.step)");
|
||||
filter << QObject::tr("IGES (*.igs *.iges)");
|
||||
filter << QObject::tr("BREP (*.brp *.brep)");
|
||||
filter << QString::fromAscii("STEP AP203 (*.stp *.step)");
|
||||
filter << QString::fromAscii("STEP AP214 (*.stp *.step)");
|
||||
filter << QString::fromAscii("IGES (*.igs *.iges)");
|
||||
filter << QString::fromAscii("BREP (*.brp *.brep)");
|
||||
|
||||
QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(), filter.join(QLatin1String(";;")));
|
||||
QString select;
|
||||
QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(), filter.join(QLatin1String(";;")), &select);
|
||||
if (!fn.isEmpty()) {
|
||||
Gui::WaitCursor wc;
|
||||
App::Document* pDoc = getDocument();
|
||||
if (!pDoc) return; // no document
|
||||
openCommand("Import Part");
|
||||
QString ext = QFileInfo(fn).suffix().toLower();
|
||||
if (ext == QLatin1String("iges") ||
|
||||
ext == QLatin1String("igs")) {
|
||||
if (select == filter[1] ||
|
||||
select == filter[2]) {
|
||||
doCommand(Doc, "import ImportGui");
|
||||
doCommand(Doc, "ImportGui.insert(\"%s\",\"%s\")", (const char*)fn.toUtf8(), pDoc->getName());
|
||||
}
|
||||
|
@ -503,17 +504,18 @@ CmdPartExport::CmdPartExport()
|
|||
void CmdPartExport::activated(int iMsg)
|
||||
{
|
||||
QStringList filter;
|
||||
filter << QObject::tr("STEP AP203 (*.stp *.step)");
|
||||
filter << QObject::tr("IGES (*.igs *.iges)");
|
||||
filter << QObject::tr("BREP (*.brp *.brep)");
|
||||
filter << QString::fromAscii("STEP AP203 (*.stp *.step)");
|
||||
filter << QString::fromAscii("STEP AP214 (*.stp *.step)");
|
||||
filter << QString::fromAscii("IGES (*.igs *.iges)");
|
||||
filter << QString::fromAscii("BREP (*.brp *.brep)");
|
||||
|
||||
QString fn = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(), QString(), QString(), filter.join(QLatin1String(";;")));
|
||||
QString select;
|
||||
QString fn = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(), QString(), QString(), filter.join(QLatin1String(";;")), &select);
|
||||
if (!fn.isEmpty()) {
|
||||
App::Document* pDoc = getDocument();
|
||||
if (!pDoc) return; // no document
|
||||
QString ext = QFileInfo(fn).suffix().toLower();
|
||||
if (ext == QLatin1String("iges") ||
|
||||
ext == QLatin1String("igs")) {
|
||||
if (select == filter[1] ||
|
||||
select == filter[2]) {
|
||||
Gui::Application::Instance->exportTo((const char*)fn.toUtf8(),pDoc->getName(),"ImportGui");
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -49,6 +49,13 @@ FreeCAD.addImportType("BREP format (*.brep *.brp)","Part")
|
|||
FreeCAD.addExportType("BREP format (*.brep *.brp)","Part")
|
||||
FreeCAD.addImportType("IGES format (*.iges *.igs)","Part")
|
||||
FreeCAD.addExportType("IGES format (*.iges *.igs)","Part")
|
||||
FreeCAD.addImportType("STEP AP214 format (*.step *.stp)","ImportGui")
|
||||
FreeCAD.addExportType("STEP AP214 format (*.step *.stp)","ImportGui")
|
||||
|
||||
# There is a bug in OCC 6.5.3 (and older which leads to a crash)
|
||||
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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user