Website Name - an official New Hampshire Government website
Smaller text size Reset text size Larger text size
link to website translation page
CAD/D HomeMicroStationMXOpenRoadsDownloadsSearchNHDOT Homelink to website translation page

Attaching Reference Files

Standard NHDOT files can be attached to the current design file with the NHRef VBA routine. This macro includes options to define the directories to be searched and two options for the list of files to be attached.

For a file to be attached, it must have a standard file name and location. A standard drawing file name consists of the State Project Number as defined by the stno variable (found in the projects's PCF file) followed by one of the standard Drawing Codes that are described in MicroStation Drawing Names.

Note: If the file is already attached, then the program will not attempt to attach it a second time. It will also not attach the current design file as a reference file.

Running the Program

The NHRef macro can be started by using the key-in vba run modNHRef.main. or select modNHRef.main from the list of macros obtained from the Utilities menu (Utilities > Macro > Macros...). The macro will provide options to select the directories to be searched and files to be attached.

Search Criteria

select search option dialog boxSelecting MS_RFDIR Variable will search directories based on the value of the MS_RFDIR configuration variable defined in the project's PCF file. If this list is too long, some items at the end of the list may not be attached. You will be warned if the value of MS_RFDIR is at the 2047 character limit. Individual directory paths defined in MS_RFDIR must end with a "/".

Selecting All Project Directories will search every directory under the one defined by the configuration variable projdir. Projdir is usually defined in the project's PCF file. If projdir is not defined, the program will search the directory containing the current design file and all sub-directories.

Selecting Files

Selecting All Standard Files will check file names against a list of recognized drawing file names. This file contains lines listing the standard Drawing Codes used at NHDOT and a Description associated with each drawing. If this file is not found, the user will be prompted for this file's location. The standard Drawing Code is also used as the Reference Logical Name.

Selecting Plan Prep Files will restrict the attachments to alignment (ALI), existing detail (EXD), field check data (EXF), and text (TXT) drawings for use by the Plan Preparation group.

Customization Options:

Settings for this program can be predefined in two ways, either by the use of variables in a MicroStation configuration file or by including choices in the key-in used to run the macro. Any choices set with a key-in will override configuration variable settings.

Configuration Variables

There are two variables that can be set to define default settings displayed in the Search option panel, NHRef_dir and NHRef_file. These would typically be defined in the user's configuration file (UCF) if desired.

  • If NHRef_dir = 0 then all directories will be searched.
  • If NHRef_dir = 1 then MS_RFDIR directories will be searched. (default value)
  • If NHRef_file = 0 then all standard files will be attached. (default value)
  • If NHRef_file = 1 then only Plan Prep files will be attached.

Command Line Options

This is an option to run the program from a key-in that defines the search and attachment choices and bypasses the program settings panel. It provides the option to run the program from a menu or function key. The key-in will be in the format vba run modNHRef.main pm where the characters at the end of the command define the options. Do not put spaces between the options. Using the command line option will override the values of the NHRef_dir and NHRef_file configuration variables. There are four choices:

  • a - attach all standard files
  • d - search all project directories
  • m - search MS_RFDIR directories
  • p - attach Plan Prep files only

New Hampshire Department of Transportation
PO Box 483  |  7 Hazen Drive  |  
Concord, NH  |  03302-0483
Tel: 603.271.3734  |  Fax: 603.271.3914