Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coustomising ugii_env.dat 3

Status
Not open for further replies.

scotty7

New member
Jul 27, 2004
111
I guess quite a lot of businesses customise their UG installation through the ugii_env.dat file. What is perceived as best practice for this (having just waded through converting an NX4 version to incorporate all the changes we put in at NX2).
1. Put the changes in the file next to the vanilla variable
2.Put the changes all together at the top or bottom of the file
3. Put the variables in a separate file and call this from ugii_env to overwrite settings made in the otherwise untouched UGS-supplied file.
4. Something else I haven't thought of!
Opinions gladly received!
 
Replies continue below

Recommended for you

I am currently setting up NX5 for our site. I have created a custom_env.dat file. The custom_env.dat file contains only the variables that I want to modify. The last line of the custom_env.dat file must read:

#include ${UGII_ROOT_DIR}\ugii_env.dat

to call the standard ugii_env.dat file. Note: the # sign must be included in the line. In this usage the # sign is not used for commenting. If the # sign is missing, UG crashes during startup.

As UG starts, the variables are read and set in the custom_env.dat file first. Then UG reads and sets the variables from the standard ugii_env.dat file. If the same variable exists within the standard ugii_env.dat file, the variable is not set again.

This file can be located locally on the users machine or located on a network server that is accessed by all users.


Set the UGII_ENV_FILE variable to point to the custom_env.dat file to read the customized variables.

This method leaves the default ugii_env.dat file intact and you do not have to worry about the ugii_env.dat getting changed during update installations.

This information was found on the citizens area.
 
Nice catch there.

Tim Flater
Senior Designer
Enkei America, Inc.

Some people are like slinkies....they don't really have a purpose, but they still bring a smile to your face when you push them down the stairs.
 
So basically what we are saying here is that the file to which UGII_ENV_FILE points to need not be a complete ugii_env.dat file, but only the CHANGES that we wish to make to the standard file. Any changes made in the custom file will overwrite the default settings on the ugii_env.dat in UGII_BASE_DIR. So the next bit of clarification is what is the customised file called - ugii_env.dat or custom.dat?

For info, with CADDS5, we had a .caddsrc file which was all of PTCs settings, and left well alone, a .caddsrc-local file, which contained site modifiations, and a .caddsenv, which could carry individual users tweaks (on a personal, rather than shared, drive).
 
scotty7,

Out of the box (no customizations), NX will use ugii_env.dat by default. You can name your custom .dat file anything you want as long as it's defined with that same name (path) in your batch file that launches NX.

Tim Flater
Senior Designer
Enkei America, Inc.

Some people are like slinkies....they don't really have a purpose, but they still bring a smile to your face when you push them down the stairs.
 
Sorry, I must be being a bit dim here.
So, I have a local, networked drive. I point UG to it by setting UGII_ENV_DIR, then create a file called custom.dat, lob my changes only into it and put it alongside a copy of the ugii_env.dat file on the network drive, and it all works?
'Cos we alrady have 2 ugii_env.dat files on this drive with different names and settings (pointing to metric.def or english.def), so which one would win out? We use the batch file that launches UG/Teamcenter to decide which to use.
 
scotty7,

For the sake of argument, let's look at this from the start.

First, we install NX. Let's say we install it on D:\Program Files\UGS\NX 5.0\. The ugii_env.dat file that NX uses without any customizing is located in D:\Program Files\UGS\NX 5.0\UGII\. NX knows where this is located by default...you don't have to "tell" it that. Remember that, because it's important.....ugii_env.dat will only appear in ONE location and that is where it's installed. Don't do anything to that file, just leave it alone for now.

Now, we need to launch NX with a batch (.bat) file because we want to use the .bat file to define the location of our CUSTOM env.dat file using the "set UGII_ENV_FILE=[YOUR CUSTOM .DAT FILE NAME HERE].dat" variable. So, we make a new text file, put "set UGII_ENV_FILE=[YOUR CUSTOM .DAT FILE NAME HERE].dat" (no quotes) in it along with the call to launch NX and any other variables that need to be set at startup and then save the text file as a .bat file. You will now use this .bat file to launch NX, and not the default shortcut. When you double click on the .bat file, it will set all the variables you have listed in it (like where your custom env.dat file is located).

Once that is done, you create another text file that is going to be saved as your custom env.dat file. Include ONLY the variables from ugii_env.dat that you want to change. If necessary, open ugii_env.dat and copy/paste from it into your custom env.dat file. Also remember to put "#include ${UGII_ROOT_DIR}\ugii_env.dat" (minus quotes) at the end of the custom env.dat file or else NX won't know to use BOTH the ugii_env.dat file AND your custom env.dat file.

You can create 2 different .bat files, one for english and one for metric to get around that issue. If you're using NX3 or newer, you're NOT using either ug_english.def or ug_metric.def files. Those were replaced with the interactive Customer Defaults in NX3, which can be set during an NX session but take affect upon the next restart. These customer defaults are stored in a .dpv file, which can be customized (in your custom env.dat file) so that it can reside locally or on a network location for use by several users.

I hope all of that makes sense.

Tim Flater
Senior Designer
Enkei America, Inc.

Some people are like slinkies....they don't really have a purpose, but they still bring a smile to your face when you push them down the stairs.
 
Thanks, Tim. Yes, this makes sense, but it makes me wonder why our local UGS guys have set us up with a complete copy of the ugii_env.dat file, to which they have made changes, in the custom directory and pointed at this.
The current exercise moving from NX2 to NX4 (and getting all the tweaks in metric.def into the dpv file), and putting all of the changes in the customised ugii_env.dat file onto the new ugii_env.dat file for NX4, has been a nightmare, which UGS didn't tell us we (or they) had to do. Being relatively new to UG, we got a bit of a shock.
Hopefully I can use your model for the next upgrade (hopefully NX6).
 
scotty7,

I would recommend visiting the bbsnotes from Siemens GTAC website. Check out the NX CAD newsgroups and Rob Cohon (a Siemens employee) will usually post customization files, from which I've based most of my setup.

I tend to find it easier to see what someone else has put in their files, then try to work backwards from there, making changes as needed.

As far as the custom env.dat files, it really doesn't matter how you do it...you can make an exact copy of ugii_env.dat or just include the variables you want. It's still going to work the same way. I just prefer to have only the ones I have changed in my .dat file for ease of editing later on down the road, if necessary.

Tim Flater
Senior Designer
Enkei America, Inc.

Some people are like slinkies....they don't really have a purpose, but they still bring a smile to your face when you push them down the stairs.
 
Agree, Tim. The issue we had is that the ugii_env.dat for NX4 is quite a bit bigger than that for NX2, so either you start from scratch and build all of the changes back into the vanilla file, or add one line and point it at your existing custom.dat file. The latter (as you have it) seems a lot easier to manage (having done the former myself).
 
Would the customizations go before the program launch in the batch file or after it? My guess is before, because once the program is launched it's not looking at lines in the batch file anymore.

TIA

Mike
 
Mike,

It depends on what variables you're wanting to set. However in the big picture, you can use multiple files to call out customizations...it just all depends on where they originate in the out of the box launch of NX.

Tim Flater
Senior Designer
Enkei America, Inc.

Some people are like slinkies....they don't really have a purpose, but they still bring a smile to your face when you push them down the stairs.
 
Mainly I'm looking to add things like our company's custom symbols, title blocks, drawing notes, etc. Nothing really tricky or fancy. Yet. ; ) Doing it all in a batch file sounds easier when making changes or doing installs on new computers. Most of my previous CAD life has been as a user. It's just now that I'm having to do some admin also. I want to try to keep it as simple as possible.

Mike


Mike
 
The thing to remember with UG is that it takes the first instance of the variable only. If the variable crops up again, even in a different file, it ignores it. So it is important to get the order of batch files right so that you get what you thought you were going to get.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor