This Client Server article is republished in its entirety from 2004 for reference purposes.
By Linda Shanley, Technical Support Analyst, Bentley Corporate Office 12 April 2004
It's becoming one of the more frequently asked questions for Bentley technical support: "How can I view an ESRI shape file in a DGN file format?"
This article provides a brief overview of that process using MicroStation GeoGraphics V8. The software required for this operation includes MicroStation and MicroStation GeoGraphics V8. A database connection to a MicroStation GeoGraphics project is also required, as it is the repository for the attribute (database) information.
You'll first need to set up your own MicroStation GeoGraphics project in order to import graphics and attributes from an ESRI shp, e00 or Mapinfo mif file.
Create a directory on your hard drive specifying where the project data will be stored. This will be the location of the Microsoft Access database and the project directory structure. For the purposes of this exercise, name the directory c:\project.
Figure 1
Figure 2 The first step is to create a data source. This requires that you locate the Microsoft ODBC drivers in the Control Panel of your computer. In some operating systems, the ODBC drivers are located under the Administrative tools.
Open the ODBC drivers dialog and click "Add." Locate the Microsoft Access driver.Click "Finish" and then enter "mydata" (or any name you choose) for Data Source Name. Click the Create button. Enter the name "mydata" for the database name and make sure that the directory c:\project is selected for the directory name.Click "OK" and the Access database and data source creation process are completed.
The next step is to create a project that you can customize to your own specifications. Using the Project Setup dialog, we will create the project directory structure and add the MicroStation GeoGraphics system tables.
Start MicroStation GeoGraphics with the icon called "MicroStation GeoGraphics," which was created when the software was installed. Pick any design file (or create a new file) and open that file. Locate the Project > Project Setup submenu. Enter the following:
Figure 3 Proj. Parent Directory: c:\project Proj. Name Directory: test
Database Server: ODBC
Database Login: mydata
Click the Create button to begin the project creation process. Click "OK" on the next dialog to create an mscatalog (the master list of all attribute tables). Select either a 2D or 3D seed file, depending on your project requirements.
When this process has been completed, a project directory named c:\project\test will be created along with the necessary project directories underneath the test folder.
The project database mydata.mdb will now contain all of the required MicroStation Geographics system tables.
Now we need to open the project to create a category, a grouping for the features, and at least one feature of each type in order to import an ESRI shp file.
Click the Open button on the Project Setup dialog. In the message center (center middle of the status bar), the message "Database: mydata" will be displayed. The project is now open.Next, open the Tables > Feature Setup dialog. This is the main dialog in which you will create the categories and features for the project.
There is no exact science in creating the features and category names, because the type of project and data collected will determine the feature names. A feature is usually equivalent to an ESRI theme. A theme is limited to a single type of vector data: point, line or polygon. For this reason, you are required to export vector data from MicroStation GeoGraphics using a feature, rather than any other designation. The feature defines the element type, and any elements with that feature linkage must be the same element type.
Figure 4
Figure 5
Figure 6 The first step is to define a category. Since we have some example tax parcel ESRI .shp data delivered with MicroStation GeoGraphics, the category will be called Assessment data. Enter the data listed in Figure 4 and click "Insert" to create the new category.
With the category highlighted, we will proceed to the feature area of the dialog. Enter the feature code and name, then click "Insert."
With the feature highlighted, enter the element type, theme type, and symbology information. Element and theme type are particularly important to the import process.
Click "Update" to add this information to the feature definition.
Repeat this process and create features with the following parameters:
Code: 2
Name:Tax lot label
Elem Type: text node
Theme type: area centroid
Color = 1 (dk blue)
Code: 3
Name:Tax street centerline
Elem Type: line string
Theme type: line feature
Color = 15 (blank)
Code: 4
Name:Tax survey monument
Elem Type: cell
Theme type: point feature
Color = 3 (red)
Library: mytown.cel
(Cell) Name: PVTMON
Note: Be sure to locate the mytown.cel library and place it in the search path of the MS_CELL configuration variable.
Figure 7 When you are finished, click the Commit button. You will have a list of features like those in Figure 7.
Now we are ready to import ESRI .shp files.
Close the Feature Setup dialog. If prompted, click "OK" to commit your changes to the database. Close the project setup dialog.
We are now ready to open the MicroStation GeoGraphics project.
Go to the Project > Open dialog. Enter the following in the dialog:Directory - C:\project\test\
Database Server - ODBC
Database Connect and Database Load (both checked on)
Figure 8 Login - mydataClick "OK" and, if prompted to overwrite work.dgn click "OK" again. You should be in a design file called work.dgn. Save this file as Import.dgn using File > Save As and save it in the c:\project\test\dgn directory.
Since the ESRI .shp files that we are importing are displayed in survey feet, we must change the working units of this design file. Key in the command "set units foot inch." The message center will display a message reflecting the working unit change (Figure 9). Go to File > Save Settings to save the new working units.
Figure 9
Figure 10 Importing the SHP, MIF or E00 file To open the Import/Export dialog, go to File > Import > SHP/MIF/E00. In the SHP/MIF/E00 Import dialog, click File > Select Import file. Locate Mylots.shp, mymons.shp, mystreets.shp in the \Bentley\program\geographics\prj\mytown\imp directory. Multiselect all three files and click "Select."
The three files will now be listed in the SHP/MIF/E00 Import dialog (Figure 10).
For each of these ESRI .shp files, the correct feature must be selected and the Import Attribute table toggle must be checked on in order to import the attribute table data. If the toggle is left off, only the graphics will import. Highlight each shape file individually and review all of the feature settings. Mylots.shp is listed as a type shape so the Area theme type is enabled. The area theme type must have two features available-in this case tax lot line and tax lot label-to import the ESRI .shp file correctly.
Enable the Import Attribute table option to import the database linkages. Mymons.shp is a type point, so the Point theme type should be enabled and the tax survey monument is listed as the feature.Enable the Import Attribute table option. Mystreets.shp is a type Line, so the Line theme type should be enabled and the tax street centerline is the available feature.Enable the Import Attribute table option. Click the Import button to begin the import process. The result should look something like Figure 11.
Figure 11 There are many other features available in the Import dialog, some of which include the ability to view the incoming attribute table structure, renaming the incoming attribute tables and attribute column names, restricting the number of attribute data columns imported, tiling data into multiple files.
Importing Graphics only
It is possible to import only the graphics without any database attribute information. The import process requires a MicroStation GeoGraphics project be opened prior to activating the Import tools, however, this can be accomplished with the delivered MicroStation GeoGraphics mytown project. A shortcut that is already set up for the mytown project is delivered in the MicroStation program group as MicroStation GeoGraphics Mytown (ODBC). Create an ODBC data source to the mytown.mdb file, following the "Create a data source" steps above.
Figure 12
Figure 13
Simply connect to the project, open the File > Import > SHP/MIF/E00 dialog and pick the file to be imported. Turn off all of the radio buttons next to any features selected - next to the words area, line, and point.
Click the Import button and the graphics will be created in the design file.
Client Server Archive
Geospatial Product TechNotes And FAQs
Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!