diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp
index 4f4da356a8..37964ab241 100644
--- a/src/Mod/Part/App/TopoShape.cpp
+++ b/src/Mod/Part/App/TopoShape.cpp
@@ -597,18 +597,21 @@ void TopoShape::importBrep(const char *FileName)
}
}
-void TopoShape::importBrep(std::istream& str)
+void TopoShape::importBrep(std::istream& str, int indicator)
{
try {
// read brep-file
BRep_Builder aBuilder;
TopoDS_Shape aShape;
#if OCC_VERSION_HEX >= 0x060300
- Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100);
- pi->NewScope(100, "Reading BREP file...");
- pi->Show();
- BRepTools::Read(aShape,str,aBuilder,pi);
- pi->EndScope();
+ if (indicator) {
+ Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100);
+ pi->NewScope(100, "Reading BREP file...");
+ pi->Show();
+ BRepTools::Read(aShape,str,aBuilder,pi);
+ pi->EndScope();
+ } else
+ BRepTools::Read(aShape,str,aBuilder);
#else
BRepTools::Read(aShape,str,aBuilder);
#endif
diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h
index d6c5078045..e6af8faee6 100644
--- a/src/Mod/Part/App/TopoShape.h
+++ b/src/Mod/Part/App/TopoShape.h
@@ -136,7 +136,7 @@ public:
void importIges(const char *FileName);
void importStep(const char *FileName);
void importBrep(const char *FileName);
- void importBrep(std::istream&);
+ void importBrep(std::istream&, int indicator=1);
void importBinary(std::istream&);
void exportIges(const char *FileName) const;
void exportStep(const char *FileName) const;
diff --git a/src/Mod/Part/App/TopoShapePy.xml b/src/Mod/Part/App/TopoShapePy.xml
index 91966033ed..4ad0dd941f 100644
--- a/src/Mod/Part/App/TopoShapePy.xml
+++ b/src/Mod/Part/App/TopoShapePy.xml
@@ -85,7 +85,9 @@ Sub-elements such as vertices, edges or faces are accessible as:
- Load the shape from a string that keeps the content in BREP format.
+ Load the shape from a string that keeps the content in BREP format.
+importBrepFromString(str,False) to not display a progress bar.
+
diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp
index 98a38f9052..93a46bdc11 100644
--- a/src/Mod/Part/App/TopoShapePyImp.cpp
+++ b/src/Mod/Part/App/TopoShapePyImp.cpp
@@ -513,13 +513,14 @@ PyObject* TopoShapePy::importBinary(PyObject *args)
PyObject* TopoShapePy::importBrepFromString(PyObject *args)
{
char* input;
- if (!PyArg_ParseTuple(args, "s", &input))
+ int indicator=1;
+ if (!PyArg_ParseTuple(args, "s|i", &input, &indicator))
return NULL;
try {
// read brep
std::stringstream str(input);
- getTopoShapePtr()->importBrep(str);
+ getTopoShapePtr()->importBrep(str,indicator);
}
catch (const Base::Exception& e) {
PyErr_SetString(PartExceptionOCCError,e.what());