Sudhanshu wrote: ↑
Sun Aug 02, 2020 7:06 am
This seems like a difficult task.
is added as a preprocessor definition in src/Mod/FemGui/CMakeLists
and so it is available in the C++ code.
But since python is an interpreted language, it seems we can't have the same thing in python.
At least not the same flag in an easy way.
So are we better of implementing this in C++ only?
It took a decent amount of searching but I think I have found at least one way of checking whether FreeCAD was compiled with Netgen or not in Python.
The idea is to have a function in C++ (maybe in Fem/Gui/Command.cpp
) that checks the FCWithNetgen
flag and returns 1 or 0. Then in python we can use ctypes
to call that function and know whether Netgen is there or not.
This approach has a few drawbacks:
1. It's very difficult to find and load the exact library from which our function would be accessible. Is it libFreeCADGui.so
is very platform dependent but it is the only built-in module out of all the alternatives given in this post
So how shall we proceed now?