Get Environment Variable in Aveva using C#

With such code its possible to get variables declared in evar.bat file:

(As an example I query network PDMSUI path that is global variable)

string pmlpath = Environment.GetEnvironmentVariable(“PDMSUI”);
string pdmsui = pmlpath.Split(‘ ‘)[0];

An with this code you can query local variable for current PDMS instance:

var pdmsexe = PdmsApplication.GetPdmsEnvironmentVariables(“PDMSEXE”);