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”);
Console.WriteLine(pdmsexe[0]);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s