TIMS3 RefUtil Reference Utility

Giffels provides a utility called REFUTIL.EXE for the Windows NT/95/98 platforms that can scan a MicroStation design file for reference file elements, and optionally modify the attachment names. The program is a non-supported utility, so support is limited.

The following is the usage help text:

Usage: refutil [-?dfhluvV] [[-i inref -o outref ] | -R inFnChgs] [-e fn] [inFn | -F inFnList]
where inFn is the input file name

[-d]

Display reference file description

[-f]

Check if reference file exists

[-h]

Print a header on listing output

[-l]

Display reference file logical name

[-u]

Display only unique reference filenames

[-F]

Operate on files listed in a specified file

[-e]

Redirect error message output to a specified file name

Replace reference filespec (case ignored):

[-i]

specify the current reference filespec to search for

[-o]

specify the new reference filespec to replace with

[-R]

use the replace strings specified in this file (single comma delimiter)


or, to strip ALL reference names down to file's basename:

[-s]

Strip any logical prefix names / full paths from all ref names

egs.

logical prefix

- PROJECTID:filename.dgn ==> filename.dgn

fullpaths

- zfa1:[121,005]filename.dgn ==> filename.dgn

 

- c:\c\proja\filename.dgn ==> filename.dgn



Note: while the REFUTIL.EXE program can list MicroStation, AutoCAD R14.01 and Unigraphic reference files, only the MicroStation reference filenames may be modified using the -i -o -R -s arguments. For AutoCAD files, you may need to contact Giffels for an additional support file.

Example usages:
If you need to replace just a single reference file attachment name in one design file you would use a command like:
> refutil -iOLDPROJ -oNEWPROJ f:\allfiles\aproj\m122.dgn

To specify more than one file in a single directory you may use a wildcard, so that the command would be like:
> refutil -iOLDPROJ -oNEWPROJ f:\allfiles\aproj\*.dgn

To specify more than one file in several different directories you should create a text file to store the names of the files such that each line is a single file spec. Or each line could be a fullpath with a wildcard file specification. For example, the input file could be named filelist.txt and might look like:
f:\allfiles\projecta\m*.dgn
f:\allfiles\projectb\a25011.dgn
f:\allfiles\projectb\subprojb\*.dgn

This input file name can be specified to the refutil.exe program using the "-F" argument. The command line to use would be like:
> refutil -iOLDPROJ -oNEWPROJ -Ffilelist.txt

If you need to substitute more than one string with another, you could run a separate execution of the refutil.exe program for each case, or you could store all the substitution strings in a text file and specify this file to the program using the "-R" argument.

Suppose you have a scenario where you need to rename TIMS3 projects. For example we will use a scenario where 3 projects are to be renamed.
Using the TIMS3 v3.x Project Navigator, or TIMS3 Data Manager, rename the project names.
For e.g.:
1. B14 -> BUILDING14
2. O11 -> OFFICE
3. WILSO_GA -> WILSON

Create a text file listing all the replacement strings. The format of the file is:
a) one replacement string sequence per line,
b) the string to be replace is listed first, the string to replace with is listed second,
c) the strings are separated by a comma.

For example, a replacement string input file looks like:
B14:,BUILDING14:
O11:,OFFICE:
WILSON_GA,2048/WILSON

The command to use on a single design file would look like:
> refutil -iOLDPROJ -oNEWPROJ f:\allfiles\projecta\m122.dgn
or with an input file list, the command would look like:
> refutil -Rreplace.txt -Ffilelist.txt

Miscellaneous Notes:
If the "-i"/"-o" and "-R" arguments are used, the strings inside the file specified by the "-R" argument will override the "-i"/"-o" strings.
The utility will modify all reference file attachment names that contain a string matching the first string, With a short project name, you must be careful that it does not get matched with the filename portion of the attachment name. To avoid this situation you could specify the project
name followed by a ':' character so that it will only find attachment names like:
B14:m001.dgn
and not others like:
PROJECTA:ab14.dgn.

How to create a list of all files in a directory tree to be scanned.
The following example will show you how to create a list file for all files in a project tree, on the Windows NT platform (for Windows 95/98 see below). It is not necessary to create a listing for each individual file, since the REFUTIL.EXE program can accept a wildcard of filenames for each directory. You could use commands like:
> DELETE UNSORTED.LIS
> FOR /F %i in ('DIR F:\ALLFILES /B /S /AD') DO ECHO %i\*.dgn >> UNSORTED.LIS
> SORT UNSORTED.LIS ALLFILES.LIS

The file ALLFILES.LIS that is created will look like:
D:\ALLFILES\a94030\*.dgn
D:\ALLFILES\a94030\a9403001\*.dgn
D:\ALLFILES\a94030\elec\*.dgn
D:\ALLFILES\bldg_one\*.dgn
D:\ALLFILES\bldg_one\architectural\*.dgn
D:\ALLFILES\bldg_one\electrical\*.dgn
D:\ALLFILES\bldg_one\mechanical\*.dgn
D:\ALLFILES\bldg_two\*.dgn
D:\ALLFILES\bldg_two\architectural\*.dgn
D:\ALLFILES\bldg_two\electrical\*.dgn
D:\ALLFILES\bldg_two\mechanical\*.dgn
D:\ALLFILES\highway\*.dgn
D:\ALLFILES\highway\lighting\*.dgn
D:\ALLFILES\highway\road_design\*.dgn
D:\ALLFILES\ice_rink\*.dgn
D:\ALLFILES\project1\*.dgn
D:\ALLFILES\project2\*.dgn
D:\ALLFILES\project3\*.dgn
D:\ALLFILES\project4\*.dgn
D:\ALLFILES\project5\*.dgn
D:\ALLFILES\project6\*.dgn

For Windows 95/98 the FOR command does not function the same way as it would under the Windows NT operating system. To create the above file you must issue the DIR command listed above and then manually edit the text file to append the wildcards at the end of each line. Preferably, you would use an editor that has keyboard macro capabilities to ease the repetitive keyboard inputting tasks.

If the new project name is not a unique name (i.e. there are duplicate subproject names under different parent directories) then you will have to determine the unique TIMS3 project id number, and use a new project name that includes the id number, such as 2048/WILSON, where the number 2048 is the unique project id number in the TIMS3 project table. You should not have projects with spaces in the name. This will confuse the MicroStation 95 reference file attachment routines. The TIMS3 Data Manager and Project Navigator will not allow you to specify a project name with a space.