calculix / beso

Python code for topology optimization using CalculiX FEM solver.
GNU Lesser General Public License v3.0
313 stars 47 forks source link

beso_main.py unable to run as macro #16

Open ruzko opened 3 years ago

ruzko commented 3 years ago

Since I began using beso half a year ago, i haven't been able to 'run optimization' in fc-gui freecad macro, or run beso_main.py as a freecad macro at all.

I've found a workaround to this, by writing a conf file with fc-gui macro, and then running beso_main.py in the terminal. After issuing the command python beso_main.py in the .Freecad/Macro/ directory, an empty window with title '11' shows up. Closing window '11', opens window '12', and so forth until i close window '15'. Only now, the actual optimization would start.

I experienced this problem while using Freecad 0.18, 0.19 and 0.20 in both Linux Mint and Manjaro.

Report view output when pressing 'run optimization' from fc-gui macro:

22:55:46 Traceback (most recent call last): 22:55:46 File "/home/jacob/.FreeCAD/Macro/beso_fc_gui.py", line 829, in on_click23 22:55:46 exec(open(os.path.join(beso_gui.beso_dir, "beso_main.py")).read()) 22:55:46 File "", line 6, in 22:55:46 File "/home/jacob/.FreeCAD/Mod/retr3d/multiprocessing/init.py", line 64, in 22:55:46 from multiprocessing.process import Process, current_process, active_children 22:55:46 File "/home/jacob/.FreeCAD/Mod/retr3d/multiprocessing/process.py", line 262 22:55:46 except SystemExit, e: 22:55:46 ^ 22:55:46 SyntaxError: invalid syntax

fandaL commented 3 years ago

I run it successfully on Linux Mint 19.3 Mate with FreeCAD 0.20.25065 (not the latest). My only idea is that it could be due to line separators of the python files in macro directory. Some text editors enable "find and replace" from \r\n to \n  But I give it a little chance to be the reason.

The issue with empty figures 11, 12... can be due to different version of the library matplotlib. Perhaps the older code will work https://github.com/fandaL/beso/commit/66f27f8a94304917954e6a1ea36769e40091fe6b from where you just copy beso_main.py

ruzko commented 3 years ago

I tried uninstalling the Retr3d workbench, and beso now runs properly as a macro

luzpaz commented 2 years ago

@fandaL you can use package.xml file to indicate what other addons this macro conflicts with