diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index be5a70701..bad749c9f 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -55,6 +55,7 @@ # include # include # include +# include #if OCC_VERSION_HEX >= 0x060500 # include # else @@ -664,8 +665,17 @@ static PyObject * exporter(PyObject *self, PyObject *args) Base::FileInfo file(filename); if (file.hasExtension("stp") || file.hasExtension("step")) { + //Interface_Static::SetCVal("write.step.schema", "AP214IS"); STEPCAFControl_Writer writer; writer.Transfer(hDoc, STEPControl_AsIs); + + // edit STEP header + APIHeaderSection_MakeHeader makeHeader(writer.Writer().Model()); + makeHeader.SetName(new TCollection_HAsciiString((const Standard_CString)filename)); + makeHeader.SetAuthorValue (1, new TCollection_HAsciiString("FreeCAD")); + makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString("FreeCAD")); + makeHeader.SetOriginatingSystem(new TCollection_HAsciiString("FreeCAD")); + makeHeader.SetDescriptionValue(1, new TCollection_HAsciiString("FreeCAD Model")); writer.Write(filename); } else if (file.hasExtension("igs") || file.hasExtension("iges")) { diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index 6bcc48860..aee9f90b1 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -95,11 +95,11 @@ void PartExport initPart() // 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"); + App::GetApplication().addImportType("STEP (*.step *.stp)","Part"); + App::GetApplication().addExportType("STEP (*.step *.stp)","Part"); #else - App::GetApplication().addImportType("STEP AP214 format (*.step *.stp)","ImportGui"); - App::GetApplication().addExportType("STEP AP214 format (*.step *.stp)","ImportGui"); + App::GetApplication().addImportType("STEP with colors (*.step *.stp)","ImportGui"); + App::GetApplication().addExportType("STEP with colors (*.step *.stp)","ImportGui"); #endif #endif diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index a7e9b8154..51f84675c 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -446,9 +446,10 @@ CmdPartImport::CmdPartImport() void CmdPartImport::activated(int iMsg) { QStringList filter; - filter << QString::fromAscii("STEP AP203 (*.stp *.step)"); - filter << QString::fromAscii("STEP AP214 (*.stp *.step)"); + filter << QString::fromAscii("STEP (*.stp *.step)"); + filter << QString::fromAscii("STEP with colors (*.stp *.step)"); filter << QString::fromAscii("IGES (*.igs *.iges)"); + filter << QString::fromAscii("IGES with colors (*.igs *.iges)"); filter << QString::fromAscii("BREP (*.brp *.brep)"); QString select; @@ -459,7 +460,7 @@ void CmdPartImport::activated(int iMsg) if (!pDoc) return; // no document openCommand("Import Part"); if (select == filter[1] || - select == filter[2]) { + select == filter[3]) { doCommand(Doc, "import ImportGui"); doCommand(Doc, "ImportGui.insert(\"%s\",\"%s\")", (const char*)fn.toUtf8(), pDoc->getName()); } @@ -504,9 +505,10 @@ CmdPartExport::CmdPartExport() void CmdPartExport::activated(int iMsg) { QStringList filter; - filter << QString::fromAscii("STEP AP203 (*.stp *.step)"); - filter << QString::fromAscii("STEP AP214 (*.stp *.step)"); + filter << QString::fromAscii("STEP (*.stp *.step)"); + filter << QString::fromAscii("STEP with colors (*.stp *.step)"); filter << QString::fromAscii("IGES (*.igs *.iges)"); + filter << QString::fromAscii("IGES with colors (*.igs *.iges)"); filter << QString::fromAscii("BREP (*.brp *.brep)"); QString select; @@ -515,7 +517,7 @@ void CmdPartExport::activated(int iMsg) App::Document* pDoc = getDocument(); if (!pDoc) return; // no document if (select == filter[1] || - select == filter[2]) { + select == filter[3]) { Gui::Application::Instance->exportTo((const char*)fn.toUtf8(),pDoc->getName(),"ImportGui"); } else { diff --git a/src/Mod/Part/Init.py b/src/Mod/Part/Init.py index 33a81998e..6da3a0373 100644 --- a/src/Mod/Part/Init.py +++ b/src/Mod/Part/Init.py @@ -54,9 +54,9 @@ FreeCAD.addExportType("IGES format (*.iges *.igs)","Part") # The registration of the STEP filetype for 64-bit is handled in initPart() import platform if platform.architecture()[0]=='32bit': - FreeCAD.addImportType("STEP AP214 format (*.step *.stp)","ImportGui") - FreeCAD.addExportType("STEP AP214 format (*.step *.stp)","ImportGui") + FreeCAD.addImportType("STEP with colors (*.step *.stp)","ImportGui") + FreeCAD.addExportType("STEP with colors (*.step *.stp)","ImportGui") #else: -# FreeCAD.addImportType("STEP AP203 format (*.step *.stp)","Part") -# FreeCAD.addExportType("STEP AP203 format (*.step *.stp)","Part") +# FreeCAD.addImportType("STEP (*.step *.stp)","Part") +# FreeCAD.addExportType("STEP (*.step *.stp)","Part")