diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index a443dad8e0..fa107b0c23 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -580,7 +580,7 @@ PyMOD_INIT_FUNC(Part) Interface_Static::SetCVal("write.iges.unit","M"); break; case 2: - Interface_Static::SetCVal("write.iges.unit","IN"); + Interface_Static::SetCVal("write.iges.unit","INCH"); break; default: Interface_Static::SetCVal("write.iges.unit","MM"); @@ -595,7 +595,7 @@ PyMOD_INIT_FUNC(Part) Interface_Static::SetCVal("write.step.unit","M"); break; case 2: - Interface_Static::SetCVal("write.step.unit","IN"); + Interface_Static::SetCVal("write.step.unit","INCH"); break; default: Interface_Static::SetCVal("write.step.unit","MM"); diff --git a/src/Mod/Part/App/AppPartPy.cpp b/src/Mod/Part/App/AppPartPy.cpp index dffbbb9968..8e5dbed693 100644 --- a/src/Mod/Part/App/AppPartPy.cpp +++ b/src/Mod/Part/App/AppPartPy.cpp @@ -395,7 +395,7 @@ public: "Part.show(r[1][0])\n" ); add_varargs_method("exportUnits",&Module::exportUnits, - "exportUnits([string=MM|M|IN]) -- Set units for exporting STEP/IGES files and returns the units." + "exportUnits([string=MM|M|INCH|FT|MI|KM|MIL|UM|CM|UIN]) -- Set units for exporting STEP/IGES files and returns the units." ); add_varargs_method("setStaticValue",&Module::setStaticValue, "setStaticValue(string,string|int|float) -- Set a name to a value The value can be a string, int or float." @@ -1740,16 +1740,11 @@ private: throw Py::Exception(); if (unit) { - if (strcmp(unit,"M") == 0 || strcmp(unit,"MM") == 0 || strcmp(unit,"IN") == 0) { - if (!Interface_Static::SetCVal("write.iges.unit",unit)) { - throw Py::RuntimeError("Failed to set 'write.iges.unit'"); - } - if (!Interface_Static::SetCVal("write.step.unit",unit)) { - throw Py::RuntimeError("Failed to set 'write.step.unit'"); - } + if (!Interface_Static::SetCVal("write.iges.unit",unit)) { + throw Py::RuntimeError("Failed to set 'write.iges.unit'"); } - else { - throw Py::ValueError("Wrong unit"); + if (!Interface_Static::SetCVal("write.step.unit",unit)) { + throw Py::RuntimeError("Failed to set 'write.step.unit'"); } } diff --git a/src/Mod/Part/Gui/DlgSettingsGeneral.cpp b/src/Mod/Part/Gui/DlgSettingsGeneral.cpp index a687134b7f..66b0bddcee 100644 --- a/src/Mod/Part/Gui/DlgSettingsGeneral.cpp +++ b/src/Mod/Part/Gui/DlgSettingsGeneral.cpp @@ -127,7 +127,7 @@ void DlgImportExportIges::saveSettings() Interface_Static::SetCVal("write.iges.unit","M"); break; case 2: - Interface_Static::SetCVal("write.iges.unit","IN"); + Interface_Static::SetCVal("write.iges.unit","INCH"); break; default: Interface_Static::SetCVal("write.iges.unit","MM"); @@ -245,7 +245,7 @@ void DlgImportExportStep::saveSettings() Interface_Static::SetCVal("write.step.unit","M"); break; case 2: - Interface_Static::SetCVal("write.step.unit","IN"); + Interface_Static::SetCVal("write.step.unit","INCH"); break; default: Interface_Static::SetCVal("write.step.unit","MM");