Not a member? Join Now
Problems signing in? Check here
This Client Server article is republished in its entirety from 2006 for reference purposes. It was written for MicroStation GeoGraphics v08.05.02.11 and MicroStation v08.05.02.35 and may not apply to any other version.
By Nelson Hobdell, Senior Technical Support Analyst 07 August 2006 Modified: 12 December 2008
This article discusses export of DGN elements to ESRI shapefile format using MicroStation GeoGraphics, from the perspective of someone who does not use MicroStation GeoGraphics. A basic understanding of MicroStation is required.
The DGN data may or may not have attribute information linked from a database.
Preparing the example project for your data
Creating GeoGraphics features
Assigning features to elements
Microsoft Windows: Any supported release, including ODBC connectivityMicroStation GeoGraphics 2004 Edition: 08.05.02.11MicroStation V8 2004 Edition: 08.05.02.35MicroStation and MicroStation GeoGraphics are both available via SELECTservices Online (http://selectservices.bentley.com/) in the downloads and updates section. A valid SELECT Contact ID with download privileges is required to download software. If you need assistance with login or privileges, please first contact your company's in-house SELECT Services Administrator. Subsequent inquiries can be made to the Bentley Administration Center for your region. (In the United States: 1-800-513-5103.)
MicroStation GeoGraphics is a MicroStation Extension. Each seat of MicroStation covered by a SELECT contract is typically allotted one extension, licensed free of charge. For details regarding availability for your account, please contact the Bentley Administration Center for your region.
-Select a new or empty directory for the installation.
Installation over a previous version can cause conflicts with pre-existing settings and configuration files when programs such as GeoGraphics are used.
-Include the MicroStation Databases component when installing.
If utilizing a pre-existing copy of MicroStation, check to ensure that databases have been installed by locating the folder:
This folder should include at least the ODBC subdirectory, as a Microsoft Access *.MDB file will be utilized in this example as the database connection.
When installation finishes for MicroStation, the MicroStation Program Group is displayed. Leave this dialog box open.
When installing GeoGraphics:
-As multiple copies of MicroStation may exist on a system, GeoGraphics will attempt to install to the location of the most recent MicroStation installation. Be certain that you are installing to the desired location.
-Include the GeoGraphics Sample Projects/Example Files component.
When installation finishes for GeoGraphics, the MicroStation Program Group includes the icons used to launch GeoGraphics and the GeoGraphics sample projects. Leave this dialog box open.
If you are accessing an existing SELECTserver installation with the appropriate licenses available:
- Create a text file in the ...\Bentley\Program\Licensing\ directory.
- Name the file "MSV8.lic".
- Using a text editor such as Notepad, edit the file to define the location of SELECTserver Licensing. For example, the text file pointing to "mylicenseserver" would read: SERVER=mylicenseserver
If you have obtained a node locked or evaluation license, follow the instructions delivered with the license.
The GeoGraphics Sample Projects/Example Files component includes multiple examples, including the mytown project. We will use this project as a surrogate for our export procedure. Of course, experienced GeoGraphics users can use their pre-existing projects.
To use the mytown project, a connection must be established to the database component of the project. We will use the Microsoft Access version of the mytown database for this project. To set up the connection, we must define a data source name (DSN) via the Microsoft ODBC Administrator.
- Open the Microsoft ODBC Administrator:
Start->Settings->Control Panel->Administrative Tools->Data Sources (ODBC)
- Choose the ‘User DSN' tab
- Select the ‘Add' button
- Select ‘Microsoft Access Driver (*.MDB) from the drivers list.
- Click Finish
- Input the ‘Data Source Name' as ‘mytown' [We use ‘mytown' because the GeoGraphics icon titled "MicroStation GeoGraphics Mytown (ODBC)" (see Figure 4) is preconfigured to look for this DSN.]
- Click Select and browse to the delivered mytown.mdb file:
- Click OK to complete the definition.
- You are returned to the main ODBC Administrator screen and should see ‘mytown' as a data source name in the User DSN tab.
-Click OK to close the ODBC Administrator dialog box.
Launch the mytown project by clicking the "MicroStation GeoGraphics Mytown (ODBC)" icon.
The design file ‘work.dgn' is loaded and the project opens automatically.
Note: If a project is opened with the ‘Work Map' toggle engaged, the software will attempt to overwrite "work.dgn". Be sure that you do not overwrite the file in this process. You should "save as" a different name to prevent this.
To confirm that the project has opened, select the GeoGraphics ‘Project' menu. The ‘open' option is disabled, indicating that the project is in the open state.
GeoGraphics can create ESRI shapefiles for the following ESRI topology types:
* Point* Line* Polygon
Each ESRI shapefile produced can only contain elements appropriate to one of the ESRI topology types. This rule is reinforced by the use of GeoGraphics features as the export medium and their Theme Type setting.
Refer to the topology matrix below to see which GeoGraphics Theme Types suit creation of the desired ESRI shapefile topology type. Options highlighted in light blue are demonstrated in this article.
ESRI Shapefile Topology
*Text and label features are exported as ESRI point topology. When exporting, any text from the element itself will not be exported. To export text attributes, the text information must be must be included as attribute information within a database attribute table. The destination software can then be used to again annotate the data with the desired text.
We will create new feature definitions for our export data for each of the above options, and subsequently assign these definitions to elements (‘featurization') prior to export.
- Select Project->Close to close the project.
- Select Project->Setup.
- Click Open in the Project Setup interface.
- Select Tables->Feature Setup.
The Feature Setup dialog box shows us that features are grouped within categories. The broader purpose of the category/feature relationship is beyond the scope of this article. Refer to your GeoGraphics documentation for more information about that topic.
We will create one category specifically to contain five features to be used for export.
- Select the existing category ‘Grids and Graticules'.
- Overwrite the displayed category name and enter ‘EXPORT' as the new category name.
- Overwrite the displayed category extension and enter ‘dgn' as the new category file extension.
- Toggle on the ‘Allow Foreign' option.
- Click the ‘Insert' button to create the new category.
Create a new feature by populating the ‘Feature' section of the dialog box:
- Enter 1 as the (feature) Code.
- Enter ‘EXPORT_POINT' as the (feature) name.
- Click Insert to create the new feature.
- Modify the feature's Theme Type to Point Feature.
- Set the line weight of the Feature to 4
- Click Update to update the feature with your changes.
Create the remaining features using the following specifications:
FEATURE CODE : 2
NAME: : EXPORT_LINE
THEME TYPE : Line Feature
COLOR : 1
WEIGHT : 1
FEATURE CODE : 3
NAME: : EXPORT_SHAPE
THEME TYPE : AREA Feature
COLOR : 2
FEATURE CODE : 4
NAME: : EXPORT_CENTROID
THEME TYPE : AREA CENTROID
COLOR : 3
WEIGHT : 4
FEATURE CODE : 5
NAME: : EXPORT_BOUNDARY
THEME TYPE : AREA BOUNDARY
COLOR : 4
When finished, click Commit to save your changes to the database and close the Feature Setup and Project Setup dialog boxes. Stay in the MicroStation GeoGraphics session.
We'll now create elements within the delivered work.dgn to test featurization and export. The user's goal of course is to utilize existing data for export, but continuing with this portion of the exercise is recommended prior to attempting featurization of existing data. In all cases, users should work with a copy of their existing data until they are comfortable with all aspects of GeoGraphics featurization.
Reopen the GeoGraphics project (Project->Open).
Set the active level to Default.
Set the active weight to 4.
Create the following elements in whatever manner you are comfortable with. (Ensure that no other elements exist within these shapes.) In this example we will create three of each, and will list the associated MicroStation key-in command (Utilities->Key-in):
POINT (Key-in: PLACE POINT)
LINE (Key-in: PLACE LINE)
SHAPE (Key-in: PLACE SHAPE)
Continue by creating three polygons, made of line elements.
Within these polygons, place one point each. These parcel-style areas may be contiguous.
When we featurize an element with GeoGraphics, we are actually creating a database linkage on the element from the GeoGraphics project's feature table.
We'll first featurize the points.
- Place a fence around the elements to be featurized.
- Open the GeoGraphics Feature Manager (Utilities->Feature Manager).
- Locate and select the EXPORT category.
- Double-click EXPORT_POINT feature to make it the active feature.
You will notice that the Active Level has become EXPORT_POINT.
- Open the GeoGraphics Features tool frame
- Select the Place Active Feature tool.
- Toggle on the Use Fence option from the MicroStation tool settings dialog.
- You are prompted to Attach Feature to Fence Contents...
- Place a datapoint in the view to accept.
Repeat the operation for the lines and shapes, activating the Feature EXPORT_LINE for each line and EXPORT_SHAPE for each shape.
To assign the features EXPORT_CENTROID and EXPORT_BOUNDARY, create a selection set of the elements to be featurized. Untoggle the Use Fence option when the Attach Feature tool is activated.
When attaching Features to mixed element types which are geographically commingled, remember these options:
- Attach Feature can operate on an individual element, a fence or a selection set.
- Selection sets can be created from the MicroStation ‘Select by attributes' tool
- Elements slated for different Features which exist on separate levels can easily be separated out of the current operation by turning level display off for all but the targeted elements.
Users wishing to further automate the process should investigate the GeoGraphics Best Feature Assignment documentation:
(Help-> GeoGraphics Contents...)
User Guide -> Data Setup -> Attach Best Feature
You will notice that during featurization, element symbology (including level assignment) is modified. This is the primary reason that working on a copy of your existing data is strongly recommended until you are familiar with the effects of featurization. In cases where the level assigned to the element is not present within the design file, the level will be created on demand. Details of this mechanism and alternate settings can be viewed within the GeoGraphics readme file, by searching on the phrase: MicroStation V8 - 2004 Edition Level Integration
For this example, we will create a new directory within the project directory to store the exported files. Of course, users may choose their own directory and file names for the resulting file.
- Open the GeoGraphics Export dialog box (File->Export->SHP/MIF...)
The Export dialog box displays all valid features found in the current session,. This includes reference files and attached GeoGraphics maps. Valid discovered features are grouped into the three topology types available for export shown previously in our topology matrix.
The export file name defaults to:
-Set the name and location of the export file to the new directory.
Use the feature's name as the name of the exported file:
Note that since the Shapefile is a conglomeration of three separate files (*.shp, *.shx, and *.dbf), the file extensions are assumed and need not be added.
- Leave the range set to All Ranges. The range setting can be used to export only a fenced area or specific view.
-Toggle the bottom Point group option, and select our feature (EXPORT_POINT) from the drop-down selector.
- Click Export, and GeoGraphics creates the shapefiles. Confirmation of export success will be displayed at the bottom of the program window within MicroStation's Message Center. If you want to view the message history, double-click the message area to expand it.
Follow the same strategy for the remaining features. See figures 22, 23, and 24 for settings. Be sure to rename the export file for each export operation.
Note that for the EXPORT_SHAPE feature, toggle the Area group and select EXPORT_SHAPE for the topmost selection. The bottom selection of the group will remain set to any point feature found, but this is ignored unless combined with the selection of an area boundary feature for the topmost selection.
Results can be re-imported into MicroStation to confirm that the desired results were obtained, or can be viewed using ESRI's free ArcExplorer download (http://www.esri.com/software/arcexplorer/index.html) .
(The following figures are from ArcMap.)
Since the ESRI shapefile format requires each element to have an attribute linkage, we see that the elements' feature linkage information is used for the attribute record exported to the *.dbf file component of the shapefile. (See figure 26.)
Of course, users with existing data containing attribute linkages will know that MicroStation itself can have multiple database linkages from multiple tables on each element. Discussing table creation and linking of attribute information is beyond the scope of this article; however, interested readers can look to the following sections of the MicroStation and GeoGraphics help for additional reading:
Administrator Guide -> External Database Interface...
User Guide -> Using MicroStation GeoGraphics -> Visual Query Builder...
When exporting elements with attribute linkages, users will need to define the table as the Associated Attribute Table within the feature definition, prior to export. Refer to the Feature Setup dialog box figures above for the location of this setting. For additional options see:
Administrator Guide -> Import/Export Modules -> Non-Graphics Database Attributes...
Client Server Archive
Geospatial Product TechNotes And FAQs
MicroStation Desktop 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!