Skip to content

Commit

Permalink
filter selection to exclude object duplicates before export
Browse files Browse the repository at this point in the history
  • Loading branch information
usakhelo authored and wwmayer committed Jun 16, 2016
1 parent fa6c880 commit dc17dbf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Gui/Application.cpp
Expand Up @@ -606,10 +606,12 @@ void Application::exportTo(const char* FileName, const char* DocName, const char
}

std::stringstream str;
std::set<App::DocumentObject*> unique_objs;
str << "__objs__=[]" << std::endl;
for (std::vector<App::DocumentObject*>::iterator it = sel.begin(); it != sel.end(); ++it) {
str << "__objs__.append(FreeCAD.getDocument(\"" << DocName << "\").getObject(\""
<< (*it)->getNameInDocument() << "\"))" << std::endl;
if (unique_objs.insert(*it).second)
str << "__objs__.append(FreeCAD.getDocument(\"" << DocName << "\").getObject(\""
<< (*it)->getNameInDocument() << "\"))" << std::endl;
}

str << "import " << Module << std::endl;
Expand Down

0 comments on commit dc17dbf

Please sign in to comment.