Skip to content

Commit

Permalink
FEM: ccx tools, read result dat file into document text object
Browse files Browse the repository at this point in the history
  • Loading branch information
UR-0 authored and berndhahnebach committed Apr 24, 2020
1 parent a2b8aa6 commit 0739c2f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Mod/Fem/femtools/ccxtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ def run(self):
)
return False
else:
FreeCAD.Console.PrintMessage("**** try to read result files\n")
self.load_results()
# TODO: output an error message if there where problems reading the results
return True
Expand Down Expand Up @@ -805,9 +806,17 @@ def load_results_ccxdat(self):
"""
import feminout.importCcxDatResults as importCcxDatResults
dat_result_file = os.path.splitext(self.inp_file_name)[0] + ".dat"

if os.path.isfile(dat_result_file):
mode_frequencies = importCcxDatResults.import_dat(dat_result_file, self.analysis)
else:

obj = FreeCAD.ActiveDocument.addObject("App::TextDocument","ccx dat file")
#self.result_object.addObject(obj)
file = open(dat_result_file, "r")
obj.Text = file.read()
file.close()

else:
raise Exception("FEM: No .dat results found at {}!".format(dat_result_file))
if mode_frequencies:
# print(mode_frequencies)
Expand Down

0 comments on commit 0739c2f

Please sign in to comment.