qingfeng.xia wrote:
1. Do you means create a CFD workbench? , that sounds challenging to me, I am not sure how to create Gui/Resource part, maybe I leave the icon still in Fem module (not sure as we did not specify icon path, but icon name),
2. then CMakeLists.txt, Init.py and InitGui.py should be make a pure python module?
You could start the new workbench not in FreeCAD src but in your ./FreeCAD Mod directory in your home directory.With this you need just a few files to start. See
https://github.com/berndhahnebach/FreeC ... aster/MyWB for my simple template for a new workbench in Mod directory of your ./FreeCAD folder in your home directory. It has just two simple tools. With this there is no Cmake needed, because no installation is needed.
Later if you would like to go for a PullRequest to integrate it in FreeCAD source you could add the Cmake stuff.
qingfeng.xia wrote:3 . If I need the post-processing and creat-meshing command, can I just import from "_CommandFemMesh.py" or I must copy into new module?
You can use any module and any object from any module in any other module. It just need to be available and of couse you need to import the module.
qingfeng.xia wrote:4. I think I need a SelectionObserver python class.
I have one small just for FEM you could import it. Arch has an own python selection observer class. Assambly2 has one too.
qingfeng.xia wrote:5. To add new command MenuItem/ToolbarItem to workbench, I need to add into Fem/Gui/Workbench.cpp. Is that possible to add into InitGui.py now? Or I should make Cfd/Gui/ cpp files.
Yes you could just add it to InitGui.py See my small template.
There are dozens of modules around which are installed in your user Mod. You could have a look at the code if you need something. One of the best is lattice2. I truelly can recomend installing it.
bernd