Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
MicroStation
  • Product Communities
MicroStation
[Archived] AskInga Wiki CSV files - remapping your data
    • 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. 

    CSV files - remapping your data

    AskInga logo

    Original Article Date: Oct 4, 2002

    MicroStation V8 uses Comma Separated Value (CSV) files for controlling the re-mapping of your graphics. This technology can be employed when converting between V7, V8, and DWG formats and can even be used to spec-check your drawings! This article is an introduction to CSV files and will walk you through a few examples of remapping a V7 file when converting to the V8 format.

    MicroStation V8 uses Comma Separated Value (CSV) files for controlling the re-mapping of your graphics. This technology can be employed when converting between V7, V8, and DWG formats and can even be used to spec-check your drawings! This article is an introduction to CSV files and will walk you through a few examples of remapping a V7 file when converting to the V8 format.

    Some background information first. A CSV file (Comma Separated Value file) is a text file where each 'column' of information is separated by a comma. CSV files can be opened and edited with any text editor or you can use Excel - in which case the file will be loaded to look like other XLS file.

    When creating a CSV file for use with V8, the following “sections” of data are available: Levels, Colors, Weights, LineStyles, Fonts and lastly CellNames.

    Each section is entered into the CSV file as follows: %section,section_name

    All of the sections noted have unique columns which you can define and ultimately "drive" the re-mapping.
    The columns are categorized as:

    • Primary - This is a required column that specifies what attribute to remap.
    • Qualifiers - These are optional columns that refine the remapping to take place.



    Each column of information performs a specific task, and rather than re-writing what's already been written, please refer to MicroStation's Help and look for the section titled Remapping Data to Other File Formats. I'd also like to draw your attention to the middle section with the title of Understanding the remapping CSV format - in there you will find a plethora of "rules and regulations" governing the use of qualifiers. You may find it beneficial to print out this entire section of the Help file and throw it in a binder for quick and easy reference.

    So, now that that's out of the way, let's take a look at a few very simple examples. Let's suppose you have a V7 file and want to re-map the file upon import to V8. Download and get acquainted with this sample V7 file.

    As you can see there's not a lot to it. Just a few elements on a couple of levels, but it'll be enough to show off some of V8's re-mapping using CSV files. What we'll do now is a series of small exercises each building upon the first. And hopefully by the end of all this, you'll be able to comfortably remap your own files. Let's get started!

    Notes:

    • Each little exercise includes a prepared CSV file for you to use.
    • Go ahead and download these files or (better yet) try creating your own!
    • If you use mine, you'll have to strip off the TXT extension!
    • The design file can be processed via Utilities > Batch Converter.
    • For information on how to use this utility, please refer to the following:
      The Batch Convert Application
      Batch Convert Utility
    • You can also direct V8 to use a specific CSV file by defining it in the MS_V7TOV8_CSVNAME configuration variable.
    • Although this article talks primarily about V7 to V8 remapping, you can use the same techniques for remapping your V8 data. Create your CSV file, use the Batch Converter utility, set the output file format to V8 and away you go!


    Example 1 - V7 to V8 remapping
    The scope of this exercise to do the following tasks:

    • Convert a V7 file to V8.
    • Assign level names.
    • Assign ByLevel attributes to the levels.
    • To leave elements untouched.



    Open the CSV file provided and notice the values entered in the Level column. This column can be used for remapping level names or level numbers. When remapping level numbers, the number must be preceded with either one or two % characters. If Excel converts %n to n% use two % characters, otherwise one will be fine.

    Once the file has been processed, the results of the remapping will be seen in the Level Manager and upon close examination of the elements, you'll see that they are unchanged from V7.

    Example 2 - V7 to V8 remapping
    The scope of this exercise is the same as Example 1, except this time we're going to:

    • Change all elements to ByLevel attributes.



    Looking at the CSV file, you can now see the addition of several other sections: Colors, LineStyles, and Weights. In each of these sections the existing numerical value of the attribute is listed in the primary column and %bylevel is entered in the corresponding V8OutPutxxx column. The %bylevel is a keyword that instructs the remapper to change the element to have ByLevel attributes.

    Back in Exercise 1, we defined the levels ByLevel attributes, so this time when the original V7 file is processed the elements adopt this new symbology and display quite differently. Actually, the file is looking rather funky!

    Example 3 - V7 to V8 remapping
    Moving right along....This time were going to:

    • Assign new level names.
    • Change the element colours.
    • Change the elements styles.
    • Leave the element weights unchanged.
    • Leave the level ByLevel attributes to the default of 0.



    When the remapper processes the CSV file, it will apply the Colour, Style, and Weight entries to the ByLevel Colour/Style/Weight and Override Colour/Style/Weight columns of the Level section. The reason for doing this is explained by Barry Bentley: "Some users want to map only the colors, and in particular don't want to list every level in the Level mapping table, put the same name in the appropriate output level column, and look up what ByLevel color they currently have and see what that maps to and put that in the ByLevelColor column. Ditto for weight and style."

    Because of this nifty feature, the ~95 keyword has been added to the ElementType column in these sections. This tells the remapper that you don't want that particular row to be applied to the ByLevel and Override columns in the Level section.

    Example 4 - V7 to V8 remapping
    In this example, we're going to:

    • Assign new level names
    • Assign ByLevel attributes to the levels
    • Change the elements to ByLevel
    • Change the fonts from USTN to TTF



    The CSV file we're using here is exactly the same as the one used in Example 2, except that we've now added a section for remapping the fonts.

    The first column represents the existing font name, the second is the existing font type while the third is output font.

    That just about wraps things up for this article. Hopefully it's given you enough information to get you started in designing your own CSV file for remapping your V7 design files to MicroStation V8.

    AskInga Article #125

    • Askinga
    • ConversionTranslation
    • Article
    • Share
    • History
    • More
    • Cancel
    • Danielle Schutz Created by Bentley Colleague Danielle Schutz
    • When: Thu, May 22 2008 9:57 AM
    • Jordan Stierly Last revision by Jordan Stierly
    • When: Wed, Jun 9 2010 2:20 PM
    • Revisions: 6
    • 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