Skip Navigation LinksNX-Network-Configuration-Part-1


NX Network Configuration Part 1:  Environment Variables 

Click here to see a video for this article.

Configuring NX for use on a company network can be a fairly serious undertaking if you really want to do it right, but in the end it is well worth it.  Something that you have to realize with setting up NX properly on your network is that for every hour you spend setting it up, you and everyone else using NX on your network is probably going to save an hour or two every month or maybe even every week, so it is important to find the time to do it.  And, of course, if you can’t find the time, you can always call us and we can do it for you.

The Environment Variables File

So the environment variables file is the Rosetta Stone of configuring NX for a network and it is the sole focus of this article.  Basically, the environment variables file tells NX where to look on your network for all of the settings, templates, libraries, scripts, printers, and anything else that you as a user can customize (which is a lot).  When you install NX (click here for instructions on how to install NX), it comes with a default environment variables file and if you install NX in the default folder, the file is at C:\Program Files\UGS\NX 7.5\UGII\ugii_env.dat.  So now you are all excited to see this magical file and you open it up and this is what you get. 

Really exciting. 

If you read the first paragraph in the file, you can see that there is another file called ugii_env_ug.dat and that is where the default values are stored, so basically, if you want to change an environment variable to something other than the default value, you put it in ugii_env.dat (put them above the line that starts with “Do not define any variables”) and it will override the value that is in ugii_env_ug.dat.  The reason for doing it this way is so if you install a new release, you don’t have to go searching through the new default environment variables file trying to find the variables that you need to override again for the new release. 

Below is a section of ugii_env_ug.dat.  In the environment variables file, each line preceded by a # is a comment line and is not read by NX, so the only line shown below that is read is the highlighted UGII_APPL…  However, some of the lines that are commented are place holders for environment variables that can be activated by copying the line to ugii_env.dat and removing the #. So what we are going to do is overwrite UGII_SITE_DIR, because this is a useful environment variable as you will see in future articles.  

The picture below is of my environment variables file and as you can see I just copied from the first line shown above down to UGII_SITE_DIR and pasted it into ugii_env.dat (which I renamed to ugii_env7.5.dat and I will explain this later) and then took the # out from in front of UGII_SITE_DIR.  You don’t need to copy all of the stuff above UGII_SITE_DIR like I did, I just do this for the sake of having the variable explanation in both files. 

Needless to say, this variable points to a directory and the directory in my case is O:\NX-CONFIG\NX7.5\SITE, and O:\ is a mapped network drive that is enforced through Group Policy to be the same on everyone’s computer so if everyone had the same environment variables file, they would all point to the same folder on the network for whatever it is that NX looks for in UGII_SITE_DIR

System Variables

So how do you make sure everyone has the same environment variables file?  You use System Variables.  Put the ugii_env.dat file that you want everyone to use in a folder on a mapped drive and then create a system variable called UGII_ENV_FILE on everyone’s computer and set the value to be the network location of the file – don’t do anything with ugii_env_ug.dat, just leave the local copy on everyone’s computer that was created when NX was installed.  You can also use Group Policy for the System Variable, so you can do all of this without touching any of the NX computers. 

After you get this all set up, open NX and go to Help->NX Log File, scroll down a little and you should see your environment variables file listed as shown below.

The reason that my file is called ugii_env7.5.dat is because I have multiple versions of NX installed and each version has unique settings and directories and scripts, etc., so when I want to switch from one version to another, I just change the value of the UGII_ENV_FILE from O:\NX-Config\NX7.5\ug_env7.5.dat to O:\NX-Config\NX6\ug_env6.dat and I know I have all the right variables loaded.  You might have noticed that there are some other version specific system variables (UGII_BASE_DIR and UGII_ROOT_DIR) and these should be changed too.  This makes switching back and forth a little cumbersome, so you can create a startup script for each version that will do it for you and I will show you how to do this in a future article. 

Have fun being an NX Network Administrator.  I know I sure do.

Dave Holland