Guide to Using DWG and Other Formats
Guide to Using DWG and Other Formats
Guide to Using DWG and Other Formats

Using the Batch Converter

The Batch Converter utility converts individual files, or entire directories of files, from any of the CAD file formats supported by MicroStation to any other supported format.

When you use the Batch Converter, you can set up a series of individual file conversions, and save them to a batch conversion job file. Later, you can open the job file and rerun the conversion using the previously set job values. The batch job updates only the files that have changed since the last time the job was run.

General Procedure — To perform a batch conversion
  1. Set up a new batch conversion job.

  2. Start the conversion process.

To set up a batch conversion job
  1. From the Utilities menu, choose Batch Converter.
    The Batch Convert dialog box opens.

  2. From the Default Output Format option menu, choose the default file format for the conversion.
    After you select files and directories to convert (steps 4–7), you can modify the output format for any of the source files.

  3. In the Default Destination field, enter the path to the destination directory for converted files. If you specify a directory that does not yet exist, MicroStation will create it when it processes the job.
    or
    Click the magnifying glass icon, and browse to the destination directory.
    After you select files and directories to convert (steps 4–7), you can further modify the destination directories.

  4. In the dialog box's icon bar, click Add Files or Directories to Convert.
    The Select Files and Directories to Convert dialog box opens. This dialog box allows multiple selection of both files and directories.

  5. Select individual files or directory(s) to convert. To also convert subdirectories, turn on Include Subdirectories. The processing for this option is recursive — that is, not only direct subdirectories are converted, but also all successive levels of subdirectories embedded in it.

  6. Click Add.
    The specifications for the selected directories or files are listed in the Selected Files list box. In directory specifications, the presence of the wildcard string “*\” at the end indicates the subdirectories are included.
    If you change your mind about a previously selected directory or file, select it in this list box, and click Remove Files.

  7. Repeat steps 5–6 until you have selected all the directories and files to convert.

  8. Click Done.
    The Select Files and Directories to Convert dialog box closes, and the Process Tasks list box in the Batch Process dialog box updates to reflect your selections.
    At this point, you can directly edit individual task entries in the Conversion Tasks list box. You can also set the output format and destination directory for an individual task(s) by changing the respective default selections above, selecting the task(s) in the list, and clicking Apply to Selection.
    To remove a task(s), select the task(s) and click the Remove Files icon in the icon bar.
    If the source column for a task contains a directory, you can edit it to include a standard file filter. For example, to convert all the files with the extension ".d04" from directory "d:\007625\" and its subdirectories, you would edit that entry's source column entry to read d:\007625\*\*.d04.

    The order in which a job's process tasks will be processed is indicated by the sequence number column (which has the heading “#”). The task list can be sorted by any of the columns, but the Edit menu options that modify the order are enabled only when sorting by the “#” column in ascending order.


  9. (Optional) Define the conversion options for individual files. Select a file, then select Edit > (Options). For example, if a file is to be output in V8 format, select Edit > V8 Save Options.

    If this step is not performed, the most recent option settings for the particular file format will be used.


To process a batch conversion job
  1. (Optional) To process selected conversion tasks, select the tasks in the Batch Convert dialog box's Conversion Tasks list box, and turn on Process Selection Only in the icon bar.

  2. In the Batch Convert dialog box's icon bar, click the Process Batch Conversion Job icon.
    The Files to Convert dialog box opens. The individual files to convert are listed.

  3. To start conversion processing, click Convert.
    The Convert button label automatically changes to Pause, and the Status column identifies the file being converted. Clicking Pause pauses processing after the current file. The Pause button label changes to Continue. Processing never stops in the middle of converting a file.
    When processing is complete, the Pause button label changes to Done.

  4. To return to the Batch Convert dialog box, click Done.

When feasible, output files are assigned the same filename as the source file. The output file timestamp is set to match the source file timestamp. When the source is in a MicroStation format and the output is an AutoCAD file, the output extension is automatically set to *.DWG or *.DXF as appropriate (all AutoCAD files must have the .DWG or .DXF extension). If there are multiple files with the same root name (differing only in extension) in the source directory, the extension is incorporated into the output file name.

Because the output file timestamp is set to match the source file timestamp, it is feasible to run a job frequently, updating the output versions of only those source files that have changed. It also makes it possible to restart a batch conversion job. When the destination file is up to date, the Status column indicates that fact.

If MicroStation files are being converted to AutoCAD files and Save References As DWG/DXF is on in the DWG Save Options dialog box, the references of each source file are processed as well as the master file. In certain instances, this results in the automatic conversion of some files that are selected as source files in a subsequent task in the same job. When processing reaches such a file, its Status updates to Already Converted.

Using drag and drop with Batch Conversion

When selecting files for batch conversion, you can use drag and drop to select files from Windows Explorer and drag them into the Conversion Tasks list box. When you drop files within an existing list of files in the list box, they are inserted between the rows in which your pointer is positioned.

Similarly, you can use drag and drop to reposition tasks in the Conversion Tasks list box. This applies only when tasks are sorted in the ascending order on the # field.

To drag files from Windows Explorer
  1. From the Utilities menu, choose Batch Converter.

  2. Open Windows Explorer, and navigate to the required folder.

  3. In Windows Explorer, select one or more files as required.

  4. Hold down the data button and drag the selected files to the Batch Convert list box, releasing the button to drop the files.
    If you want the files to be dropped between two existing tasks, position the pointer between them prior to dropping the new files.

Using drag and drop to re-order tasks
  1. Check that tasks in the Conversion Tasks list box are sorted in ascending order on the # field.

  2. Select the file(s) that you want to reposition in the list (use <Ctrl> data to select multiple files).

  3. Hold down the data button and drag the selected file(s) to the required position, releasing the data button to complete the task.
    Each of the selected files is moved up or down the list by the same number of rows.

Copying files from source directories

As part of a job's specified conversion tasks, you can also copy other types of files from directories that contain CAD files to convert. The configuration variable MS_BATCHCONVERT_COPYEXT specifies the extensions of files that will be copied from directories specified as a source for a conversion task. For example, to copy all the files with the extension “.rsc” or “.txt” to your output directory, define MS_BATCHCONVERT_COPYEXT as rsc;txt. In the default workspace, MS_BATCHCONVERT_COPYEXT is not defined, and the Batch Conversion dialog box therefore performs only file conversions.

To copy CAD files without converting them, simply set up a conversion task(s) for which the output and source formats are the same.

Saving and recalling batch conversion jobs

If you plan to reuse the job setup in future jobs, you should save it to a batch conversion job file. This text file is similar to a Windows initialization file. It contains DWG open and save options, the log file name, and all conversion tasks. You can edit it in a text editor if desired.

To save the job setup to a batch conversion job file
  1. From the File menu in the Batch Convert dialog box, choose Save or Save As.
    The Save Batch Convert Job File dialog box opens.

  2. In the Files field, key in the desired filename. The default extension is “.bcnv.”

  3. Click OK.
    The file is created, the dialog box closes, and the focus returns to the Batch Convert dialog box.

If you change the job setup in MicroStation, you can save the modified setup to the same batch conversion job file by choosing File > Save or to a new file by choosing File > Save As.

To load a saved batch conversion job setup
  1. From the File menu in the Batch Convert dialog box, choose Open.
    The Open Batch Convert Job File dialog box opens.

  2. In the Files list box, select the desired batch conversion job file.

  3. Click OK.
    The dialog box closes, and the focus returns to the Batch Convert dialog box. In that dialog box, the Conversion Tasks list box updates to show the tasks specified in the file.

Alternative Method — To load a saved batch conversion job setup
  1. In the Key-in window, key in: MDL LOAD batchconvert -nodialog <batch_conversion_job_file_specification>. For example: MDL LOAD -nodialog c:\Bentley\Workspace\Projects\Examples\General\my_conversion.bcnv
    The Files to Convert dialog box opens. At this point you can click Convert to start the job or Cancel.

Command line batch conversion

You can run a job saved in a batch conversion job file directly from the system command line.

To run a saved batch conversion job from the system command line
  1. If MicroStation is running, exit.

  2. In the MicroStation program group, open the MicroStation Development Shell program item. This causes a MicroStation Development Shell window to open on your desktop.
    or
    In a system console window, set the current working directory to the directory in which the MicroStation executable program is installed — for example, "Bentley\Program\MicroStation"

  3. At the system command prompt, enter: msbatch batchconvert <batch_conversion_job_file_specification>. For example: msbatch batchconvert c:\Bentley\Workspace\Projects\Examples\General\my_conversion.bcnv
    MicroStation starts without its normal graphical interface, and processing of the job begins. A MicroStation console (Text) window opens so you can monitor the progress of the job. The text displayed in this window is also written to the log file specified in the job setup. When the job is completed, the console window closes.