diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index d2848bac32..7f7a87ae60 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -546,16 +546,12 @@ private: Base::FileInfo file(Utf8Name.c_str()); if (file.hasExtension("stp") || file.hasExtension("step")) { - //Interface_Static::SetCVal("write.step.schema", "AP214IS"); - bool optionScheme_214; - bool optionScheme_203; - ParameterGrp::handle hGrp_stp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Import/hSTEP"); - optionScheme_214 = hGrp_stp->GetBool("Scheme_214",true); - optionScheme_203 = hGrp_stp->GetBool("Scheme_203",false); - if (optionScheme_214) - Interface_Static::SetCVal("write.step.schema", "AP214IS"); - if (optionScheme_203) + ParameterGrp::handle hGrp_stp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part/STEP"); + std::string scheme = hGrp_stp->GetASCII("Scheme", "AP214IS"); + if (scheme == "AP203") Interface_Static::SetCVal("write.step.schema", "AP203"); + else if (scheme == "AP214IS") + Interface_Static::SetCVal("write.step.schema", "AP214IS"); STEPCAFControl_Writer writer; Interface_Static::SetIVal("write.step.assembly",1); diff --git a/src/Mod/Import/Init.py b/src/Mod/Import/Init.py index 7f7ea3a4db..437e0225c5 100644 --- a/src/Mod/Import/Init.py +++ b/src/Mod/Import/Init.py @@ -40,9 +40,3 @@ FreeCAD.addExportType("STEPZ zip File Type (*.stpZ *.stpz)","stepZ") paramGetV = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Import/hSTEP") if paramGetV.GetBool("ReadShapeCompoundMode", False) != paramGetV.GetBool("ReadShapeCompoundMode", True): paramGetV.SetBool("ReadShapeCompoundMode", True) - -if paramGetV.GetBool("Scheme_203", False) != paramGetV.GetBool("Scheme_203", True): - paramGetV.SetBool("Scheme_203", False) - -if paramGetV.GetBool("Scheme_214", False) != paramGetV.GetBool("Scheme_214", True): - paramGetV.SetBool("Scheme_214", True) diff --git a/src/Mod/Import/InitGui.py b/src/Mod/Import/InitGui.py index edc4b99253..52d8416694 100644 --- a/src/Mod/Import/InitGui.py +++ b/src/Mod/Import/InitGui.py @@ -68,5 +68,6 @@ class ImportWorkbench ( Workbench ): Gui.addWorkbench("Import",ImportWorkbench()) """ -import Import_rc -FreeCADGui.addPreferencePage(":/ui/preferences-import.ui","Import-Export") +# See https://forum.freecadweb.org/viewtopic.php?f=3&t=26782 +#import Import_rc +#FreeCADGui.addPreferencePage(":/ui/preferences-import.ui","Import-Export") diff --git a/src/Mod/Import/Resources/ui/preferences-import.ui b/src/Mod/Import/Resources/ui/preferences-import.ui index 105f4329fb..2af3f04629 100644 --- a/src/Mod/Import/Resources/ui/preferences-import.ui +++ b/src/Mod/Import/Resources/ui/preferences-import.ui @@ -49,7 +49,7 @@ Scheme_203 - Mod/Part/hSTEP + Mod/Import/hSTEP diff --git a/src/Mod/Part/Gui/DlgImportExportStep.ui b/src/Mod/Part/Gui/DlgImportExportStep.ui index 855ff4c8cf..22afb2193c 100644 --- a/src/Mod/Part/Gui/DlgImportExportStep.ui +++ b/src/Mod/Part/Gui/DlgImportExportStep.ui @@ -7,13 +7,52 @@ 0 0 445 - 291 + 323 STEP + + + + Header + + + + + + Company + + + + + + + + + + Author + + + + + + + + + + Product + + + + + + + + + @@ -95,46 +134,7 @@ - - - - Header - - - - - - Company - - - - - - - - - - Author - - - - - - - - - - Product - - - - - - - - - - + Qt::Vertical @@ -147,8 +147,43 @@ + + + + Import + + + + + + If this is checked, no Compound merge will be done during file reading (slower but higher details). + + + Enable STEP Compound merge + + + true + + + ReadShapeCompoundMode + + + Mod/Import/hSTEP + + + + + + + + + Gui::PrefCheckBox + QCheckBox +
Gui/PrefWidgets.h
+
+
comboBoxUnits checkBoxPcurves diff --git a/src/Mod/Part/Gui/DlgSettingsGeneral.cpp b/src/Mod/Part/Gui/DlgSettingsGeneral.cpp index fa5c60f72e..d0cf0f94ee 100644 --- a/src/Mod/Part/Gui/DlgSettingsGeneral.cpp +++ b/src/Mod/Part/Gui/DlgSettingsGeneral.cpp @@ -230,14 +230,17 @@ void DlgImportExportStep::saveSettings() } else { // possible values: AP214CD (1996), AP214DIS (1998), AP214IS (2002) - Interface_Static::SetCVal("write.step.schema","AP214CD"); - hStepGrp->SetASCII("Scheme", "AP214CD"); + Interface_Static::SetCVal("write.step.schema","AP214IS"); + hStepGrp->SetASCII("Scheme", "AP214IS"); } // header info hStepGrp->SetASCII("Company", ui->lineEditCompany->text().toLatin1()); hStepGrp->SetASCII("Author", ui->lineEditAuthor->text().toLatin1()); //hStepGrp->SetASCII("Product", ui->lineEditProduct->text().toLatin1()); + + // (h)STEP of Import module + ui->checkBoxMergeCompound->onSave(); } void DlgImportExportStep::loadSettings() @@ -269,6 +272,9 @@ void DlgImportExportStep::loadSettings() ui->lineEditAuthor->setText(QString::fromStdString(hStepGrp->GetASCII("Author"))); ui->lineEditProduct->setText(QString::fromLatin1( Interface_Static::CVal("write.step.product.name"))); + + // (h)STEP of Import module + ui->checkBoxMergeCompound->onRestore(); } /**