Cancel
Showing results for 
Search instead for 
Did you mean: 

how to read NX env variables such as UGII_PYTHONPATH using ufunc program

Hi All,

 

I am trying to read the UGII_PYTHONPATH env variable using ufunc program.

If I use  C method 

pathValue = getenv("UGII_PYTHONPATH");

 it returns NULL.

 

Can you please let me know if there is any way to do this.

 

Thanks,

Ramesh

 

 

2 REPLIES 2

Re: how to read NX env variables such as UGII_PYTHONPATH using ufunc program

Siemens Phenom Siemens Phenom
Siemens Phenom

The C stdlib getenv function can only return environment variables defined on OS level like Control Panel but it cannot return the environment variables defined in UGII_ENV_FILE.

 

If you want to use the legacy Open C, the Open C Reference Guide provides a (full text) search to find UF_translate_variable in the uf.h section and examples can be found with a Solution Center search.

 

For the newer NXOpen C++ API you may prefer GetEnvironmentVariableValue or other language derivates.

Re: how to read NX env variables such as UGII_PYTHONPATH using ufunc program

Thank you Beetle for the answer.