Get Environment Variable

How can I get a system variable in my journaling code?
I'm not asking for the Windows System Variable like UGII_BASE_DIR. That can easily be done by something like this.

Dim baseDir As String = Environment.GetEnvironmentVariable("UGII_BASE_DIR")

I'm looking for the variables which is listed in ugii_env.dat or ugii_env_ug.dat. Like for instance UGCHECKMATE_USER_DIR

You can get access to all the NX environment variables through the options manager. A small example can be found here:
http://nxjournaling.com/content/load-all-defaults-annotation-preferences...

You can get a list of all the variable names by exporting them from the customer defaults. Warning: this process may tie up NX for several minutes. Start NX, open the customer defaults, in the upper right hand corner, press the "manage current settings" button. Use the "export defaults to spreadsheet" option to write all the variable names and current values to an Excel file. Once you know the variable name, you can use the options manager to get/set the value. Note that changes to some variables don't take effect immediately (NX may need to be restarted).

Thank you for the answer. It might be useful for me later, but it didn’t give me what I wanted.
The path to the folder wasn’t visible in Customer Default.

Typically it is listed as an environment variable in either ugii_env.dat or ugii_env_ug.dat
UGCHECKMATE_USER_DIR=\\some_server_name\dfa_files
It is this value I’m looking for.

Best Regards
Gunnar

Using the technique posted previously, check out the "CheckMate_userDir_UNX" and "CheckMate_userDir_WIN" variables.

I have checked this method but "CheckMate_userDir_WIN" doesn't give any value back. And that is correct because when I manually check the Customer Default it has no value.
Still NX Log File reports UGCHECKMATE_USER_DIR=\\some_server_name\dfa_files
That's because this Environment Variable is set in ugii_env.dat.

Best Regards
Gunnar

Ok, try the .GetEnvironmentVariableValue method of the NX session object.

Option Strict Off
Imports System

Imports NXOpen
Imports NXOpen.UF

Module Module104

Dim theSession As Session = Session.GetSession()
Dim theUFSession As UFSession = UFSession.GetUFSession()
Dim lw As ListingWindow = theSession.ListingWindow

Sub Main()

lw.Open()
lw.WriteLine(theSession.GetEnvironmentVariableValue("UGCHECKMATE_USER_DIR"))

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer
Return Session.LibraryUnloadOption.Immediately
End Function

End Module

Thank you very much. Your suggestion worked well.

Best Regards
Gunnar