Your Federal Quarterly Tax Payments are due April 15th Get Help Now >>

remapping by keralaguest

VIEWS: 10 PAGES: 9

									MicroStation’s Remap Facility

MicroStation V8 version 08.00.02, includes a new facility to allow table driven
remapping of levels, symbology, fonts, and cell names when a file is saved using the
“Save As” or Batch Convert utility. This facility can be used for several purposes:

1. Remapping on format conversion. This is necessary, for example, when saving a V8
   file to V7. Since V8 supports more levels, longer cell names, and more font options
   than MicroStation V7, mapping decisions must be made. The remapping tables allow
   the user to guide those decisions. Similarly, MicroStation V8 supports more
   sophisticated line styles than Autocad, so some remapping is needed.

2. Standards conversion. When V7, V8, or DWG files are received from another
   organization, or when files are to be provided to another organization, there is often a
   need to change the levels or symbology of graphics elements.

3. Bulk processing. Using the Batch Convert utility in conjunction with remapping
   allows some creative uses, such as consolidation of levels, font changes, cell name
   changes, etc.

The remapping operation is applied to the elements while they are in V8 format just prior
to saving them to the output format specified in the Save As operation or by the Batch
Converter operation.

Note: there are a few other remap operations that are sometimes applied while files are
read in to MicroStation V8. For example, when files in MicroStation V7 format are read,
the level remapping specified by the csv file pointed to by the
MS_V7TOV8_CSVNAME configuration variable is applied. Similarly, when files in
Autocad DWG or DXF format there is a programmatic remap of the Autocad 2000
weights into MicroStation element weights. These remappings are not controlled by the
remapping table described herein, which applies to output only.


Setting up the Remapping Application

The remap application is started automatically when you use MicroStation’s “Save As”
or “Batch Converter” commands. When performing the Save As operation, the user
interface is contained in the “Remap” tab for in the dialog accessed through the Options
pushbutton in the Save As dialog. From the Batch Converter, the remap user interface is
contained in the “Remap” tab in the dialogs opened using the “Dwg Save Options”, “V8
Save Options” and “V7 Save Options” entries in the Edit pulldown menu.

To create a mapping table, you use the rightmost icon in the first line of the Remap tab.
The tool tip for this icon reads “Create CSV remapping file”. That creates a spreadsheet
that can be edited with a spreadsheet editor such as Microsoft Excel, as explained below.
The Mapping Table

The remapping operation is guided by a remapping table. The format of the file is a
comma-separated-value, or “csv” file of the type that can be produced by spreadsheet
programs such as Microsoft Excel. The remapping csv file contains sections for each type
of remapping that can be accomplished. The same remapping file can be used for saving
files in MicroStation V7 format, Autocad DWG or DXF format, or MicroStation V8
format. Therefore, it is possible to create a single mapping table that can be used for a
particular project regardless of the type of output files desired.

While it is possible to edit the remapping csv files with a text editor, this is quite
inconvenient because you have to manually keep track of the column positions and the
columns generally do not line up in text mode. Alternatively, the csv file can be opened
by Excel or another spreadsheet program, but this also is difficult because there is no way
to save formatting information in a csv file, and no way to split the aforementioned
remapping sections that are discussed below into different worksheets. Therefore, an
Excel spreadsheet is provided with MicroStation to simplify the process of creating the
remapping files. The spreadsheet contains a VBA macro that detects file saves, and
writes out the equivalent information to a csv file in the same directory and with the same
root file name as the spreadsheet, but with the extension “.csv” rather than “.xls”. For this
to work, the macros must be enabled in the spreadsheet (either make sure that the Macro
Virus Protection checkbox is off in the General Tab of the Options dialog box, or respond
“Enable Macros” in the dialog box that comes up when the file is opened).

If you elect to use the spreadsheet mechanism for editing your remapping tables (and
Bentley strongly suggest that you do so), it important that you always edit the spreadsheet
and let it write the csv file. When you edit the remapping tables from MicroStation’s
graphical user interface, it automatically uses the spreadsheet mechanism.


Sections in the Remapping Table

The sections in the remapping csv file are delimited by lines that start with “%section” as
the first column, followed by the section name in the next column. The case of “section”
and the section name are not important. For example the line:

%section,Levels

marks the start of the levels section. The end of a section is either the start of the next
section or the end of the file. The first line after the start of a section must have the
column names, separated by commas. The column names required in a section are
defined in the descriptions of each section below. If you use the spreadsheet method of
editing remapping tables, the section headers are automatically generated, and the
spreadsheet is pre-populated with appropriate headers.
Remapping Qualifiers

The basic remapping operation is to change a particular parameter of a graphics element
to another value of the same parameter. For example, changing the color of elements
from index 4 in the color table to index 3, or changing the level of elements from “Level
23” to something more descriptive like “Annotation”. The remapping table provides a
mechanism for remapping Levels, Colors, Line Styles, and Line Weights in that manner.
However, it is frequently the case that not every element with a given value should be
changed to the same target value. For example, you may want to move all text on Level
23 to the Annotation level, but leave the lines on Level 23 alone. Or you might want to
change only the elements with weight 7 from color 3 to color 4, or you might want to
change all elements with weight other than 2 from color 3 to color 4. The Levels, Colors,
Line Styles, and Weights sections of the remapping table have optional “qualifier”
columns to allow this degree of selectivity.

Each section has a required column that is the “primary key” for the remapping
operation. This is always the element parameter that is being changed. In additions, there
are five optional columns for the five other parameters that can be used to qualify
elements that match the primary key. For example, in the Levels section, the required
primary key column is “Level”, and the optional qualifier columns are “Color”,
“Weight”, “LineStyle”, “Class”, and “ElementType”. Similarly, for the Colors section,
the required primary key column is “Colors”, and the optional qualifier columns are
“Level”, “Weight”, “LineStyle”, “Class”, and “ElementType”. If a row contains an entry
in any of the qualifier columns, then the element parameter must match that entry or it
will not be remapped. If a row contains an entry that starts with the character ‘~’, then the
element parameter must not match the remainder of that entry or it will not be remapped.
For example, to change the color of all weight 7 elements with color 3 to color 4, the
“Weight” column would have the entry “7”. To change all elements with a weight other
than 2 from color 3 to color 4, the “Weight” column would have the entry “~2”. There
can be only one entry in the qualifier for each row, but it is possible to have as many rows
as needed with all entries the same except a particular qualifier. For example, to change
the color of all weight 5 and weight 7 elements from color 3 to color 4, two rows, one
with weight qualifier 5, and one with weight qualifier 7, would be used.

To determine the appropriate values for the ElementType column, select an element of
the type that you want to remap, and use the Element Information tool in Microstation.
The appropriate integer value appears to the right the type name in the tree view in the
left hand pane. For example, the type of Line elements is 3.

The Class column can either contain integer class values, or the entries “Primary”,
“Construction”, or “Dimension”, which are class values of 0, 2, and 3, respectively.


The Levels remapping section

The levels remapping section starts with the line
%section,Levels

And contains the following columns:

Level - the name or number of the source level to remap.

V7OutputLevel – the number of the level when saved to a V7 file.

V8OutputLevel – the name of the level when saved to a V8 file.

DWGOutputLayer – the name of the layer when saved to a DWG or DXF file.

The Level column must contain a level name. The icon in the Level column header
provides an easy way to populate the Level column with the names of the levels from the
design file that MicroStation is currently editing. When the icon is clicked, levels that are
not currently in the table are added to the top of the table.

For each element, MicroStation finds the entry in the level map that matches that level,
and uses the output level in V7OutputLevel, V8OutputLevel, or
DWGOutputLayer, depending on the target format. If an element’s level does not
appear in the Level column, the level is unchanged, except if the target format is
MicroStation V7. When saving to MicroStation V7, if the level is not found, the level
number is used. If that level number is greater than 63, the level modulo 64 is used. For
example, an element on a level with level number 101, for which there is no entry in the
Level column matching the name of its level, is assigned to level 37 in the output V7
file.

If the destination column corresponding to the target of a Save As operation is missing, or
that column does not have an entry for a particular row, the default mapping described
above applies. Similarly, if there is no Level column or no Level remapping section, the
default mapping is applied for the whole file.

As discussed in the Remapping Qualifiers section above, the elements for which the
remapping in a particular row applies can be qualified using the optional Color,
Weight, LineStyle, Class, and ElementType columns. While editing the
remapping spreadsheet, those columns are displayed when the “Show Optional Columns”
checkbox is checked. To distinguish them from the required columns, they are shown
with a different background color.


The Color remapping section

The color remapping section starts with the line:

%section,Colors
and contains the following columns:

Color – the color to remap

V7OutputColor – the color when saved to V7 file

V8OutputColor – the color when saved to V8 file

DWGOutputColor – the color when saved to DWG or DXF file.

When MicroStation saves files to DWG, by default it maps the color indices in the DGN
color table to the closest color in the (fixed) Autocad color table. If the
DWGOutputColor entry is a color in the file’s color table, simply enter the number of
the color in the DWGOutputColor column. If a fixed index in the Autocad color table
is desired (i.e. if you do not want the color matching to be applied), enter the Autocad
color number with the suffix “ac”, as in the following example:


%SECTION,Colors
Color,DWGOutputColor
14,62ac

If the keyword “%unmapped” appears in the Color column, then every element that
has a color that does not otherwise appear in the Color column is mapped to the
destination specified in the %unmapped row. If there is more than one %unmapped
row in the section with the same values for the qualifiers columns, the last one is used.

If the keyword “%bylevel” appears in the V8OutputColor or DwgOutputColor
column, then every element that has the color indicated is changed to be ByLevel. The
V7 file format does not support ByLevel, so that keyword is invalid in the
V7OutputColor column.

As discussed in the Remapping Qualifiers section above, the elements for which the
remapping in a particular row applies can be qualified using the optional Level,
Weight, LineStyle, Class, and ElementType columns. While editing the
remapping spreadsheet, those columns are displayed when the “Show Optional Columns”
checkbox is checked. To distinguish them from the required columns, they are shown
with a different background color.




The Weight remapping section
The line weight remapping section starts with the line:

%section,Weights

and contains the following columns:

Weight – the weight to remap

V7OutputWeight – the weight when saved to V7 file

V8OutputColor – the weight when saved to V8 file

DWGOutputWeight – the weight when saved to DWG or DXF file
     and/or
DWGOutputColor – the color that the weight is mapped to when saving as DWG or
DXF.

If the keyword “%unmapped” appears in the Weight column, then every element that
has a weight that does not otherwise appear in the Weight column is mapped to the
destination specified in the %unmapped row. If there is more than one %unmapped
row in the section with the same values for the qualifier columns, the last one is used.

If the keyword “%bylevel” appears in the V8OutputWeight or
DwgOutputWeight column, then every element that has the weight indicated is
changed to be ByLevel. The V7 file format does not support ByLevel, so that
keyword is invalid in the V7OutputWeight column.

Prior to Autocad 2000, the DWG format did not have a way to store line weights. Some
users established plotting line weights by setting element colors based on their desired
line weights. If the output format is DWG or DXF, either a DWGOutputWeight or a
DWGOutputColor column, (or both) can be included. The remapping operation will
set the output line color based on the source weight if the DWGOutputColor is present,
and will set the output line weight based on the source weight if the
DWGOutputWeight column is present and the DWG version selected supports line
weight. If a DWGOutputColor column is included in the weight mapping section,
make sure that there is no DWGOutputColor column in the color mapping section, or
the results are unpredictable.

When the target is AutoCAD 2000 or later, you can map directly to Autocad line weights
rather than through MicroStation’s default linear formula for setting Autocad line weights
from MicroStation line weights, by entering values in the DWGOutputWeight in mm,
i.e.

%SECTION,Weights
Weight,DWGOutputWeight
1,0.15mm

The “mm” is required whenever the value should be interpreted as mm rather than pixels.

As discussed in the Remapping Qualifiers section above, the elements for which the
remapping in a particular row applies can be qualified using the optional Level,
Color, LineStyle, Class, and ElementType columns. While editing the
remapping spreadsheet, those columns are displayed when the “Show Optional Columns”
checkbox is checked. To distinguish them from the required columns, they are shown
with a different background color.


The LineStyle remapping section

The line style remapping section starts with the line:

%section,LineStyles

and contains the following columns:

LineStyle – the name or number of the source line style to remap

V7OutputLineStyle – the name or number of the line style when saved to V7 file

V7OutputScale – the scale factor for the style when saved to V7 file.

V8OutputLineStyle – the name or number of the line style when saved to V8 file

V8OutputScale – the scale factor for the style when saved to V8 file.

DWGOutputLineStyle – the name of the line style when saved to DWG or DXF file

DWGOutputLineStyleFile – the name of the Autocad line style file that contains
the line style.

DWGOutputScale – the scale factor for the style when saved to a DWG file.

The keyword “%drop” can appear in any of the OutputLineStyle columns. When
it does, any element with the corresponding LineStyle is stroked to multiple elements
that represent the appearance of the source element.

If the keyword “%unmapped” appears in the LineStyle column, then every element
that has a line style that does not otherwise appear in the LineStyle column is mapped
to the destination specified in the %unmapped row. If there is more than one
%unmapped row in the section, the last one is used.
If the keyword “%bylevel” appears in the V8OutputLineStyle or
DwgOutputLineStyle column, then every element that has the line style indicated is
changed to be ByLevel. The V7 file format does not support ByLevel, so that
keyword is invalid in the V7OutputColor column.

The line styles are scaled by the factor in the appropriate *OutputScale column. If
that column is missing, or if there is no value for a particular row, a value of 1.0 is used.


As discussed in the Remapping Qualifiers section above, the elements for which the
remapping in a particular row applies can be qualified using the optional Level,
Color, Weight, Class, and ElementType columns. While editing the
remapping spreadsheet, those columns are displayed when the “Show Optional Columns”
checkbox is checked. To distinguish them from the required columns, they are shown
with a different background color.


The Font remapping section

The font remapping section starts with the line:

%section,Fonts

and contains the following columns:

Font – the name or number of the source font to remap

FontType - the font type. This column can be blank, or contain one of the values
“USTN”, “SHX” or “TT” for MicroStation, Autocad SHX, or true type fonts, respectively.
If the entry is blank for a particular row, the remapper finds the first font with the name
specified in the Font column. If there is more than one font with the same name but
different type (for example, a “Courier” true type font and a “Courier” SHX font, then
two rows are required in the table to map them both.

V7OutputFont – the name or number of the font when saved to V7 file. The
destination font must be a “USTN” font. Otherwise text elements with the Font will not
be remapped if the source font is a “USTN” font, or will be mapped to Font 0 if the
source font is a true type or SHX font.

V8OutputFont – the name of the font when saved to V8 file.

V8OutputFontType – the type of the font. This can be blank, or one of the values
“USTN”, “SHX”, or “TT”. If left blank, the remapper finds the first font with the name
specified.
DWGOutputFont – the name of the font when saved to DWG or DXF file.

DWGOutputFontType - This must be one of the values “SHX” or “TT”.



The CellName remapping section

Cell names can be remapped only when saving to the MicroStation V7 format. This is
needed because prior to V8 MicroStation had a six-character limit for cell names. The
cell name remapping section starts with the line

%section,CellNames

and contains the following two columns:

CellName – the cell name to remap

V7OutputCellName – the cell name when saved to V7 file

The names in the V7OutputCellName column must be no longer than six characters, and
can contain only the letters A through Z, the numerals 0 through 9, and the characters ‘.’,
‘$’, ‘_’ and the space character.

								
To top