How to use UGMerge

Syntax:

ugmerge.exe <file1> <file2> <destination> <delimiter>

UGMerge is a merging program used with Unigraphics CAD to merge two sets of files creating the single file <destination> derived from <file1> and <file2> where the values in <file2> take precedence over the values in <file1>.

<file1> is a full definition file (i.e. ug_english.def, as installed) made available globally via the LAN.

<file2>, which is optional, normally contains only the settings that are unique to a specific user. If this file is not used, or cannot be found, then <destination> file will be the same as <file1>. The settings in <file2> will always take precedence over the settings in <file1>.

Installation/Setup

There is no setup program, so the system will need to be configured manually. Here's what needs to be done:

  1. Create a folder called \ug_shared\ugs180 on a network drive. (use whatever version is appropriate)
  2. Create a folder called \ug_custom\ugs180 on a drive unique to any users requiring custom settings. I use the user's "Home" drive.
  3. Place a copy of ugii_env.dat and ug_english.def in the network \ug_shared\ugs180 folder.
  4. Make text files named ugii_env.dat and ug_english.def in the user specific \ug_custom\ugs180 folder. It is not necessary to copy the original files, it's preferred if these files contain only custom settings.
  5. In the text files you create above, add any entries that are unique to that user, following the same format as the original files.
  6. Unzip all files packaged in UGMerge.zip into the network folder \ug_shared.
  7. If the users are not Administrators, the security permissions will need to be changed on the local ugii_env.dat and ug_english.def files to allow the user who will be logged into the workstation to overwrite them with the merged version. Personally, I give All Users Full Control over these two files.
  8. Either make a new .bat file that calls UG or modify the existing .bat file to include the follow two command lines, replacing the network drives with your own network drives:
  9. Be certain to include the <delimiter>. Without it, the system won't work. With a wrong <delimiter>, results can be ugly. This is the character used so the merging program knows where the key stops and the value starts. Note the colon (:) used in the .def files and the equals (=) used in the .dat files.
  10. Now point the shortcuts used to start UG to the batch file where the ugparse commands reside. Use this shortcut to start Unigraphics every time.

Example

Assume the following environment:

Drive Mappings:

c:\
Local HDD where OS loads.
d:\
Local HDD where Unigraphics is installed.
h:\
Network "Home" drive (unique to each user)
r:\
Network share

Folders:

c:\winnt
OS
d:\ugs180
UG v18 Installation
h:\ugconfig\ugs180
Folder in home drive for custom .dat and .def files.
r:\ug_shared\ugs180
Location for global .dat and .def files.

The company Widgets Inc. uses a custom ug_english.dat file. After installing UG, they modify ug_english.dat to their liking and place it in r:\ug_shared\ugs180. Everyone in the company uses the same plot_queue HP650_WIDTH except Jan, who usually plots color and prefers the default queue HP650_COLOR. In this case, Administrator would place a text file named ug_english.dat in Jan's home drive and make the following entry in this file:

UG_defaultPlotQueueName: HP650_COLOR

When Jan starts UG via a custom batch file, UGMerge will be executed, merge the two .dat files creating a new .dat file and place that file in the local UGS folder, overwriting the existing ug_english.dat file. That new, local .dat file will now have the appropriate default plot_queue whilst all other users will be using the default plot_queue defined in the global definition file.

Troubleshooting

Following is a list of general troubleshooting items I've come across.