Batch Convert is a utility delivered as part of MicroStation V8. The Batch Convert application is used to convert individual files or entire directories of files from any of the CAD formats supported by MicroStation to any other supported format. File formats currently supported include MicroStation/J, MicroStation V8, AutoCAD DWG and AutoCAD DXF.
To start the Batch Convert Application, select the Utilities > Batch Converter... entry from the Main Menu. The Batch Convert dialog will appear (Figure 1).
Figure 1 BatchConvert dialog
In addition to DGN or DWG files, if the output format is set to V8, the first step in using this utility is to set up a Batch Convert job. Note that if the output format is set to MicroStation V8, you will be able to convert pre-MicroStation V8 cell libraries to the MicroStation V8 format. You can also browse for the destination directory using the Browse icon. If the directory entered does not exist, Batch Convert will create it when the job is processed.
Next, identify your conversion tasks by clicking on the Add Files or Directories icon. That brings up a file selection dialog (Figure 2) with a few additional features that are specific to the Batch Convert application.
Figure 2 Selecting files for batch conversion
This dialog allows multiple selection of both files and directories. The Add button automatically enables when a file or directory selection is made. Clicking this button adds the selected files or directories to the list displayed in the lower section of the dialog. If directories are selected and the Include Subdirectories toggle is checked on, the directory name is followed by the wildcard string, *\ to indicate that the subdirectories will be included in conversion operations.
When you have selected the files and directories that need conversion, click the "Done" button. At this point, the source files and directories are added to the table in Batch Convert dialog, with the output format and directory as selected in the first step. If the source, the output format or output directory for any row needs to be changed, the entries in the table can be directly edited to correct the data. Alternatively, the Apply to Selection button can be used to incorporate the default output format and directory from their settings at the top of the dialog.
If an entry in the source column contains a directory, it can be edited to include a standard file filter. For example, if you wanted to convert all the files with the extension .d04 from directory d:\007625\ and its subdirectories, the source column entry would read d:\007625\*\*.d04.
When an entry in the source column is a directory, all files from that directory that have an extension in the list defined by MS_BATCHCONVERT_COPYEXT will be copied to the destination directory. For example, if you want Batch Convert to copy all the files with the extension .rsc or .txt to your output directory, define MS_BATCHCONVERT_COPYEXT as rsc;txt. By default, MS_BATCHCONVERT_COPYEXT is not defined, and only files in one of the design formats are processed.
If you plan to perform file format conversions more than once, you should consider saving your batch convert setup as a "job." To do this, click the Save Batch Convert Job icon or select the Save option from the File menu. The default extension for batch conversion job files is .bcnv. Once you have saved a batch conversion job, you can recall it by clicking on the Open Batch Convert Job icon or selecting Open from the File menu. The DWG open and save options, the log file name and all conversion tasks are saved to the batch conversion job file. The batch conversion job file is a text file similar to Windows initialization files and can be edited with a text editor, if desired (Figure 3).
Figure 3 Typical batch conversion job file
When the batch conversion job is set up as desired, the conversion process can be started by clicking on the Process Batch Convert Job icon or selecting File > Process... from the main menu. If you want to convert only a portion of the job, select the rows that are to be processed and turn on the Process Selections Only toggle.
When the conversion is started, a dialog appears displaying a list of the files to be converted and the progress of the overall conversion job (Figure 4).
Figure 4 Batch conversion status dialog
If desired, the batch conversion application can be run from a Command Shell. To use Batch Convert in this mode, first create and save a batch conversion job in the manner described above. Next, exit MicroStation and open a Command shell. The easiest way to do this is to use the MicroStation V8 Development Shell option in the MicroStation program group.
From the Command shell prompt, enter the command:
msbatch batchconvert <batchconvertjobfile>
where <batchconvertjobfile> is the full file specification of the batch convert job file. In this case, progress messages are output to the MicroStation console window. These messages are also written to the log file.