From bc9b8bcf19eb0105cabccafcf3ae8c49c9601751 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 1 Apr 2015 11:09:46 +0200 Subject: [PATCH] + support .inp file format --- src/Mod/Fem/Gui/AppFemGuiPy.cpp | 8 +++++--- src/Mod/Fem/Init.py | 1 + src/Mod/Fem/MechanicalAnalysis.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Mod/Fem/Gui/AppFemGuiPy.cpp b/src/Mod/Fem/Gui/AppFemGuiPy.cpp index 16a6c1f16..d34ba93b8 100755 --- a/src/Mod/Fem/Gui/AppFemGuiPy.cpp +++ b/src/Mod/Fem/Gui/AppFemGuiPy.cpp @@ -76,7 +76,7 @@ static PyObject * getActiveAnalysis(PyObject *self, PyObject *args) } /* module functions */ -static PyObject * openEditor(PyObject *self, PyObject *args) +static PyObject * open(PyObject *self, PyObject *args) { char* Name; const char* DocName; @@ -124,7 +124,9 @@ struct PyMethodDef FemGui_Import_methods[] = { "setActiveAnalysis(AnalysisObject) -- Set the Analysis object in work."}, {"getActiveAnalysis" ,getActiveAnalysis ,METH_VARARGS, "getActiveAnalysis() -- Returns the Analysis object in work."}, - {"openEditor" ,openEditor ,METH_VARARGS, - "openEditor() -- Opens a simple text editor for an FEM file."}, + {"open" ,open ,METH_VARARGS, + "open(string) -- Opens an Abaqus file in a text editor."}, + {"insert" ,open ,METH_VARARGS, + "insert(string,string) -- Opens an Abaqus file in a text editor."}, {NULL, NULL} /* end of table marker */ }; diff --git a/src/Mod/Fem/Init.py b/src/Mod/Fem/Init.py index dbaabd46a..a1de6c055 100755 --- a/src/Mod/Fem/Init.py +++ b/src/Mod/Fem/Init.py @@ -30,3 +30,4 @@ FreeCAD.addExportType("TetGen file (*.poly)","convert2TetGen") FreeCAD.addImportType("FEM formats (*.unv *.med *.dat *.bdf)","Fem") FreeCAD.addExportType("FEM formats (*.unv *.med *.dat *.inp)","Fem") FreeCAD.addImportType("CalculiX result (*.frd)","CalculixLib") +FreeCAD.addImportType("Abaqus file (*.inp)","FemGui") diff --git a/src/Mod/Fem/MechanicalAnalysis.py b/src/Mod/Fem/MechanicalAnalysis.py index 0aa0edd2f..27c1e1afc 100644 --- a/src/Mod/Fem/MechanicalAnalysis.py +++ b/src/Mod/Fem/MechanicalAnalysis.py @@ -560,7 +560,7 @@ class _JobControlTaskPanel: # The Abaqus syntax highlighter works similarly to that one of SciTE so that our # own editor can be used now import FemGui - FemGui.openEditor(filename) + FemGui.open(filename) def runCalculix(self): print 'runCalculix'