Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
MicroStation
  • Product Communities
MicroStation
[Archived] AskInga Wiki The Batch Convert application
    • Sign In

    • -AskInga
      • +3D MicroStation
      • +AccuDraw Secrets
      • +Animation - Rendering
      • +Behind The Scenes
      • +Cells
      • +Colours
      • -Conversion - Translation
        • Convert between imperial and metric design files
        • Convert contents of PDF to JPG to attach as reference
        • Convert DWG Files to 2D DGNs instead of 3D
        • CSV files - remapping your data
        • Determine the original file format
        • DWG to DGN and the default level
        • Fence export macro
        • Keyin to do a Save As with a file name
        • Output multiple formats with batch convert
        • Save As using selection sets and fences
        • Starting Batch Convert from a command line
        • The Batch Convert application
      • +Coordinate Input
      • +Design Settings
      • +Dimensions
      • +DWG
      • +EDG
      • +Element Manipulation
      • +Element Properties
      • +Element Selection
      • +Freeware - Shareware
      • +Interface Look And Feel
      • +Internet - E-Links - Links
      • +Keyins
      • +Levels
      • +Line Styles
      • +Models
      • +MSM Archive
      • +Other
      • +Presentations
      • +Printing - Plotting
      • +Programming - Automation
      • +Rasters - Images
      • +References
      • +Tags - Data Fields - Fields
      • +Text - Fonts - Annotation
      • +Views
      • +Windows - Interacting With
      • +Workspaces - Configuration
    • graffiti

     
     Questions about this article, topic, or product? Click here. 

    The Batch Convert application

    AskInga logo

    Original Article Date: Dec 19, 2001

    This article, also written by Barry Bentley explores the new utility in MicroStation V8 called Batch Convert. This application is used to convert individual files, or entire directories of files from any of the design file formats supported by MicroStation to any other supported format.

    The MicroStation Batch Convert Application:

    Batch Convert is a new utility delivered as part of MicroStation 08.00.01.xx. The Batch Convert application is used to convert individual files, or entire directories of files from any of the design file formats supported by MicroStation to any other supported format. File formats currently supported include: MicroStation V7, MicroStation V8, AutoCAD DWG and AutoCAD DXF.

    To start the Batch Convert Application select the Batch Converter... entry located on the Utilities pulldown menu. The Batch Convert dialog box appears:

    Setting up a Batch Conversion Job:
    The first step to using this utility is to set up a Batch Convert Job. Select the output format desired using the Default Output Format combo box, and select the output directory by entering it in the Default Destination text field. Note that if the output format is set to V8 you will be able to convert pre-V8 cell libraries to the V8 format. You can also browse for the destination directory using the browse icon. If the directory entered does not exist, Batch Convert will attempt to create it when the job is processed.

    Next, add your conversion tasks by clicking on the Add Files or Directories icon. That brings up a file selection dialog with a few additional features that are specific to the Batch Convert application.

    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 box. 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, press “Done”. At this point, the source files and directories are added to the table in Batch Convert dialog box, with the output format and directory as selected in the first step. If the source, 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.

    Notes:

    • Different rows can have different output formats and destination directories.
    • The order of conversion is indicated by the sequence number column (which has the heading “#”).
    • Rows can be removed from the conversions table using either the Remove Conversion selection in the Edit menu, or the Remove Files icon.
    • Conversions 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.
    • If Autocad files are involved as source files, the settings accessed through the DWG Open Options selection on the Edit menu are used.
    • If any files are to be output in Autocad format, the settings accessed through the DWG Save Options selection on the Edit menu are used.
    • The Logfile Options selection on the Edit menu is used to set a log file and to specify whether it should be emptied prior to conversion processing.

      Saving and Recalling Batch Conversion Jobs:
      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.

      Processing Batch Conversion Jobs:
      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 the Process... option from the File menu. If you want to convert only a portion of the job, select the rows that are to be processed and turn on Process Selections Only toggle.

      When the conversion is started, a dialog box appears that displays a list of the files to be converted and the progress of the overall conversion job.

      Notes:

      • If the source format is the same as the output format the source file is simply copied from the input location to the output directory.
      • When feasible, Batch Convert uses the source file name for the output file. When the source is in MicroStation V7 or V8 format and the output is an Autocad file, the output extension is automatically set to .dwg or .dxf as appropriate.
      • 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. This is due to the fact that all Autocad files must have the dwg or dxf extension.
      • Batch convert checks to see if the output file exists, and if so, whether it is the same date as the source file. If so, it does not bother to convert or copy the source file to the output.
      • The file time of the output file is set to match the file time of the input. This feature makes it feasible to run the batch conversion application for 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.
      • When the conversion process is started, the Convert button automatically changes to “Pause”. Clicking Pause directs the Batch Convert application to pause after converting the current file. The button then changes to Resume. The application never stops in the middle of converting a file.
      • If MicroStation V7 or V8 files are being converted to Autocad files, and the Save References As DWG/DXF toggle in the DWG Save Options is turned ON, then the references of each file are processed as well as the master file. In certain instances, this results in the automatic conversion of some files that are in the batch conversion job before they are reached in the table. In that case the Status column will change to Already Converted when the batch conversion process reaches such a file.
      • When the conversion process is finished, the Convert / Pause / Resume button changes to read Done, and the Cancel button is disabled. ClickingDone closes the dialog.
      • Pressing the Cancel button stops the batch convert job after the current file is finished.
      • As files are converted, the status of the conversion is displayed in the Status column and the time required for the conversion or copy is displayed in the Time column.
      • More details about the conversion process are written to the log file. This log file can be opened using any text editor such as Notepad.
      • When the conversion process ends, the table can be sorted by any column. It can be quite useful to sort by the Status or Time field in particular.

      Running the Batch Conversion application without graphics:
      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:

      ustation –wabatchconvert –i

      where 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.

     AskInga Article #93

    • Askinga
    • ConversionTranslation
    • Article
    • Share
    • History
    • More
    • Cancel
    • Danielle Schutz Created by Bentley Colleague Danielle Schutz
    • When: Thu, May 22 2008 9:46 AM
    • Inga Morozoff Last revision by Bentley Colleague Inga Morozoff
    • When: Wed, Jun 9 2010 2:47 PM
    • Revisions: 7
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies