+ support of merging projects on App level
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <Base/FileInfo.h>
|
||||
#include "DocumentObject.h"
|
||||
#include "DocumentObjectPy.h"
|
||||
#include "MergeDocuments.h"
|
||||
|
||||
// inclusion of the generated files (generated By DocumentPy.xml)
|
||||
#include "DocumentPy.h"
|
||||
@@ -135,6 +136,22 @@ PyObject* DocumentPy::restore(PyObject * args)
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* DocumentPy::mergeProject(PyObject * args)
|
||||
{
|
||||
char* filename;
|
||||
if (!PyArg_ParseTuple(args, "s", &filename)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
|
||||
PY_TRY {
|
||||
Base::FileInfo fi(filename);
|
||||
Base::ifstream str(fi, std::ios::in | std::ios::binary);
|
||||
App::Document* doc = getDocumentPtr();
|
||||
MergeDocuments md(doc);
|
||||
md.importObjects(str);
|
||||
Py_Return;
|
||||
} PY_CATCH;
|
||||
}
|
||||
|
||||
PyObject* DocumentPy::exportGraphviz(PyObject * args)
|
||||
{
|
||||
char* fn=0;
|
||||
|
||||
Reference in New Issue
Block a user