filter selection to exclude object duplicates before export
This commit is contained in:
parent
fa6c8805ba
commit
dc17dbf510
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user