Hello,
TL/DR:
How to get the current working directory in Paraview 5.4.x inside a running macro? os.getcwd() returns the base installation directory of Paraview.
Some background:
I have been looking around for a while and failed to find a solution to this. We are using py-Macros to automate some stuff. I am currently modernizing a script for a recent Paraview version (5.10.x) but I want to improve some things along the way while keeping it compatible with the version it was originally scripted for: 5.4.1.
The script involves reading a pvsm state from disc that is positioned in the same folder as the macro. This is an arbitrary folder. Currently, we are required to provide this very directory in the header of the script in order to find required files for the run. The usual way of doing os.getcwd() returns the Paraview base installation path instead of the path the script is located at. Is there another way of accessing the script path while running in the Python shell in Paraview?
Thank you.