Original Article Date: June 24, 2004
In this article, Kees van Prooijen walks you through the process of using MicroStation's EdG (Edit Graphics) utility to verify, check and repair V7 design files prior to migrating to V8.
Before you start moving data to MicroStation V8, it's suggested that you check your existing design files and cell libraries. To do this, you will use MicroStation's EdG (Edit Graphics) utility to check whether the V7 format is correct and repair the data if needed.
Software used in this process:
MicroStation V7 is used for verifying the existing data. The default install directory for MS V7 is c:\Bentley\Program\.
MicroStation V8 will then be used for checking the results of the verifying process. The default install directory of MicroStation V8 is c:\program files\Bentley\Program\
A Visual Basic macro called SearchEdGErrors.mvba is supplied with this article and will is used for checking the results. Download and place it in this folder:c:\program files\Bentley\Workspace\Standards\vba\
The EdG Batch Utility:
In the EdG directory for MicroStation V7 (c:\bentley\Program\edg\) there is the executable called edg.exe. In the same directory there is a BAT file called edgbatch.bat that will be used to start the EdG utility for checking the design files. In this article I will refer to the files found in the following delivered V7 folder: c:\bentley\Workspace\projects\examples\mapping\dgn\
The EdG batch file is run with the following syntax:
edgbatch [file with EdG commands] [design-file], [...]
For example, edgbatch edgCheck.edg *.cad,*.tax
The following EdG commands will backup the design file (.BAK), create a journal file (.JNL), verifies and repair the file if necessary. These EdG commands are written in an text file called EdgCheck.edg and are included in the zip file.
Check the Files:
Extract EdgCheck.edg from the zip file and place in ...\program\edg\ folder.
Open the MicroStation Development shell in a DOS window:
From the Windows Start menu, select Program > MicroStation > MicroStation Development Shell
Set the Path variable to the EdG program directory by executing this keyin:
Go to the directory with the design files with this keyin:
Now start checking the design files and cell libraries by keying in the following:
edgBatch EdgCheck.edg *.dgn,*.cel
For every design file a backup file (BAK) and a journal file (JNL) will be created.
Check the Results:
The resulting journal files can be checked with any text based editor, or text search tool. In this case you will use the supplied Visual Basic macro that is started within MicroStation (V8 or higher).
Start MicroStation V8 and open any design file.
Open the VBA Project Manager by going to Utilities > Macros > Project Manager
Select the Load Project icon and select the project file c:\program files\Bentley\Workspace\Standards\vba\SearchEDGError
Note, you can load VBA applications without opening the VBA Project Manager dialog by using this keyin:
vba load SearchEDGErrors.
Next the macro is run with the key-in: vba run tools.start
The EdG Errors dialog box is opened. With the Search button you can enter the path of the journal files: c:\bentley\Workspace\projects\examples\mapping\dgn\
All journal files on this directory and subdirectories are checked for errors and warnings. The names (including the path) of the files with errors or warnings are listed in the EdG Errors dialog box. When errors cannot be resolved automatically, additional EdG commands are needed to fix the problems.
Additional information about EdG can be found on this technote:
AskInga Articl #211