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:
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:
Example 1 - V7 to V8 remapping The scope of this exercise to do the following tasks:
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:
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:
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:
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