Attaching Reference Files with the NHRef Macro
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 project's PCF File) followed by one of the standard Drawing Codes that are described in MicroStation Drawing Names.
Note: If a 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 the key-in vba run NHRef or select NHRef from the list of macros on the Utilities tab and clicking Play. The macro will provide options to select the directories to be searched and files to be attached.
Search Criteria
Selecting MS_RFDIR Variable will search directories based on the value of the MS_RFDIR configuration variable defined in the project's (workset's) CFG 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 (workset's) CFG 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 defined in a file named drawlist.txt stored in the macro folder of the NHDOT workspace. 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), field check data (EXF), and text (eTXT) 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 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