You are on page 1of 34

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?

MicroStation GeoGraphics organizes mapping data into projects-a collection of categories, features, maps and attribute definitions used to organize geoengineering information. A project is defined by its database systems tables, design files, map index and feature group definitions. Lets create a typical project, one that already has maps prepared, with tabular data to be added later.

MicroStation and MicroStation GeoGraphics are mandatory. You


may use any of the supported Windows operating systems and databases with this workflow.

Database and directory creation


In Workflow 1, we worked with MicroStation GeoGraphics tools that dont need a database to work. To take advantage of the powerful geoengineering and GIS tools in MicroStation GeoGraphics, you need to work with a database. MicroStation GeoGraphics supports a number of relational databases. Refer to the MicroStation GeoGraphics Users Guide and the readfrst.txt for a detailed list of supported databases. This workflow assumes you do not have a database set up for your design files, so we want to start with an empty database. The examples given here use ODBC with Microsoft Access. The steps to create an empty database in Oracle or other

MicroStation GeoGraphics Workflows

7-1

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
relational database, will be different than the ones shown in this workflow. Once you have the empty database, the rest of the steps will apply.

Create an empty Access database and define an ODBC Data Source Name
You can create an empty Access .mdb file with the ODBC Administrator. If a shortcut or icon is not available, the ODBC Administrator can be found in the Control Panel. Open up the ODBC Administrator.

Click the Add button. - This opens the Create New Data Source dialog box.

Select the Microsoft Access driver. - Click the Finish button. This opens the Setup dialog box. Enter a name in the Data Source Name (DSN) field. This

7-2

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
name will be used to login to the database when opening your project in MicroStation GeoGraphics. For example: mymaps The Description field that is optional. Click the Create button - This opens the New Database dialog box. In the Database Name field enter the name for your .mdb file. For example: mymaps.mdb In the Directories list, select the location for your .mdb file and click OK. For example: d:\project\mymaps\

Note: This needs to be an existing directory. You may want to create a project directory in the root directory on a local or network hard drive. This can be the main directory where MicroStation GeoGraphics projects are stored. (You may have a special directory already created for this.) It is recommended that you store your own projects outside of the MicroStation tree (the default project directory is \Bentley\Program\GeoGraphics\prj). A message should display that the database has been created successfully.

MicroStation GeoGraphics Workflows

7-3

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in? Creating the Project Directories and System Tables
Now that you have an empty database, you are ready to create the directories and tables you will use in your MicroStation GeoGraphics project. Start MicroStation GeoGraphics. Open up any DGN file. From the Project menu, select Setup. This opens the Project Setup dialog box.

By default, the Project Parent Directory and Project Name Directory are defined for the MYTOWN example. The Project Name is the name of the subdirectory under the Project Parent Directory. This subdirectory and others will be created by the MicroStation GeoGraphics Project Setup utility if they dont already exist. For example, if the directory your project exists in is: D:\project\mymaps D:\project\ is the project parent directory, and mymaps is the project name directory. Change the Project Parent Directory to your new project parent directory. Change the Project Name Directory to your new project name directory. By default the Database Server is set to Oracle. In this example and ODBC/Microsoft Access database is used, so change the Database Server to ODBC. Type in your ODBC Data Source Name in the Database Login field. Click Create.

You will likely see an alert message that No MSCATALOG exists. You can disregard this message, as MicroStation GeoGraphics will create an MSCATALOG table for you. The next dialog box you encounter will be the Project Seed File dialog box. This is where you can select the seed file that will be used when creating

7-4

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
WORK.dgn (the default active design file created when you open a MicroStation GeoGraphics project). You may want to prepare the seed file ahead of time to your own standards. When you click Create, MicroStation GeoGraphics completes multiple tasks:

 

It creates the project directory structure from the GG.dir file (located in \Bentley\Program\GeoGraphics\setup). If you look in Windows Explorer, you will see that the Project Name Directory has been created under the Project Parent Directory. Under the Project Name Directory, sub-directories have been created.

C:\project\mymaps \DGN \fea \IDX index dgn vicinity dgn \ima \imp \qb \scr \SEED seed2d dgn \ses \sql \tmp \wps \wrk The \DGN, \IDX, and \SEED directories are mandatory, the other directories are optional. By default, the \DGN directory holds the project DGN and raster image files, the \IDX directory contains the index.dgn (registered map index shape) and vicinity.dgn (the projects base map or key view), and \SEED which contains the seed2d.dgn file used to create the Work.dgn active design file.

  

It copies the seed file you selected into the \SEED directory in the project directory structure. It makes copies of this seed file to create index.dgn and vicinity.dgn under the \IDX directory. It adds the MicroStation GeoGraphics system tables and MSCATALOG table to your .mdb database file using the

MicroStation GeoGraphics Workflows

7-5

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
Cretable.sql script from the \Bentley\Program\GeoGraphics\setup directory. From the Database menu, select SQL Query Builder. - This opens the Visual SQL Query Builder. Click on the Tables button. - This opens the Select Table dialog box.

You can see that a number of tables have been created including feature, category and maps.

The tables that have been created are: category feature maps mscatalog ugcategory ugfeature ugmap msforms ugcommand ugjoin_cat ugtable join

These tables can also be viewed in your database software (in this case Microsoft Access).

7-6

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?

Feature and category creation


Now that you have the project and system tables created, you can begin defining the categories and feature of your project. When designing your project, consider the following: Simplicity is key. The simpler the design, the easier it is to document, maintain, execute and edit. Start small. Its better to have a small project that works well than to have a complicated project that few understand and even fewer can use. Design for the data that you have. Dont design for what you may have in the future-new data can always be added later. Make sure that each feature has a defined or existing source. Think through your design in terms of actual MicroStation implementation. MicroStation GeoGraphics runs within MicroStation, and therefore shares some of MicroStations constraints, such as writing to one design file at a time. Take into account your computers speed, memory and overall storage space when planning your file sizes. It is easier to process and handle a large block of data if it is divided among many medium-sized files. Spread your features (within a single category) over as many levels as possible. Dont place more than one feature on more than one level if you plan on using Level Mode often. If you do have many features within a single category, organize these on single levels. For example, you should place all traffic sign features on one level, all speed sign features on another level and all curb detail features on a third level. Youll also want to allocate some scratch levels for error flags, as well as additional levels for future expansion.

To define the categories and feature for your project: In the Tables menu of the Project Setup dialog box, select Feature Setup (if youve since closed the Project Setup dialog box, you

MicroStation GeoGraphics Workflows

7-7

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
must reopen it, enter your project login information, then click the Open button to reconnect.).

This will open the Feature Setup dialog box, which populates the Feature and UGFeature tables.

Adding a category
A category is a grouping of similar features, often arranged in hierarchical order. It is defined by the maps and features that they comprise. All maps in a category should share the same file extension. This helps in identifying which category a map is in, even if the MAPS table is not loaded. An example of using

7-8

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
file extensions to identify maps would be *.str for street maps or *.veg for vegetation maps.

Suppose we have already created a wetland map and we want to make a wetland category. Enter the name Wetlands in the Name area. Enter index.dgn in the Index File field. Enter wet in the Extension field. Choose a level - This is the level for the index shape when it is registered in the index file. Allow Foreign - enables the created category to contain features shared with other categories Overlaps - enables map index polygons in the category to overlap. Raster - only used if this a raster image category (see Registering Maps).

MicroStation GeoGraphics Workflows

7-9

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
Click Insert to add this information into the Category box.

Repeat these steps to create additional categories. If you need to make changes, edit the field and click Update.

Adding a feature
You have created a category. The next step is to define the features. Features are graphic elements representing real world objects. They have defined symbology and element types. Features typically belong to a single category. A feature can be associated with a user attribute table, as well as have a MicroStation key-in command associated with it (this provides a standard set of operations when placing it via Feature Manager). An example would be associating the Place Line command with a tax.lot.line feature-each time this feature is activated, the Place Line command is invoked. Highlight the category youd like to add features to. Click a data point to place focus in the Code field of the Feature area. Enter a feature code (this can be any number your want, such as 1.1.1). Feature coding provides a hierarchical method of arranging features numerically. Enter a name for your feature (such as Wetlnd.border) The Notes field is optional. Click the Insert button.

The information you just entered will appear in the features list. When you highlight the feature, the rest of the feature attribute options become available. Specify the Element Type (i.e. Line, Line String, Text Node, etc.) The Theme Type is optional. The Theme Type describes what kind of feature it is - Area Boundary, Text Feature, Label

7-10

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
Feature, etc. If you dont have a Theme Type, choose Not Defined. Select an Element Strength; this determines how the element type may be attached to other elements (Interest, Similar, or Exact). Enter the level number on which you would like the feature to reside. If you are using existing maps, it is important to use the level number that has already been assigned to elements in your existing map to which you want to attach this feature. This is so you may work in Level mode from the Display Manager and still be able to see the Category features by their assigned level, instead of assigned feature coding. (This may be desirable at points in your project when you are performing overlays, color theming, etc.) Key in a value for Display Order and Priority

Priority deals with what symbology will display on an element that has multiple feature linkages. The lower the number set for Priority, the higher display priority it gets. Display Order affects the order in which elements get painted on the screen when they are crossing, overlap-ping, etc.-the highernumbered features are painted on top of lower-numbered features. Priority will override Display Order on a single line that has multiple feature linkages. For example, if a line has two feature linkages with feature1 having a Priority of 1 and a Display Order of 1, and feature2 with a Priority of 2 with a Display Order of 3, Priority will rule and the line will display with the symbology of feature1. If a line with a single feature linkage (lets call it feature3) crosses the feature1/ feature2 line and has a Display Order of 2, then at that intersection, the line will be displayed with the symbology of feature3. In this case, Display Order will determine what symbology is used. There is no priority because Priority only applies to elements with multiple feature linkages attached. The MicroStation GeoGraphics Users Guide states that Priority will affect the Find Gap command. What this means is that when you have Find Gaps in Repair mode, it only moves the feature to close the gap with the lowest priority-it doesnt move the one with the highest priority. Other topological clean-up

MicroStation GeoGraphics Workflows

7-11

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
commands, such as Find Dangles, will not be affected by Priority, since excess elements are being chopped off, rather than moved. Make sure you key in a value in the Tolerance field (10 is a good number). If no value is input for this field, you will not be able to select any of your features. Choose a Snap Mode that is appropriate for the feature (i.e. Keypoint, Intersection, etc.). Enter values for Min. Zoom and Max. Zoom. Min. Zoom and Max. Zoom are the working units zoom values for scale dependent viewing. Min. Zoom defines the minimum zoom level for a feature being displayed. Max. Zoom defines the maximum zoom level for a feature to be displayed. These values are activated with the Scale option in the Display Manager for Feature mode only. If Scale is set on, it will turn on/turn off the display of features according to the defined Min. and Max. Zoom levels from Feature Setup. Select a Line Weight that is appropriate for the feature (Line Weight of 3, 5, etc.). Select a Line Style that is appropriate for the feature (dotted, solid, short dashed, etc.). Select a Color that is appropriate for the feature.

The Table key-in field is used to associate a user attribute table with a feature. This field is not mandatory, although it is used for auto-attribution and in conjunction with other products like MicroStation GeoExchange and

7-12

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
ModelServer Discovery. If you do have a user attribute table that you would like to associate with a feature, enter the user attribute table name here. Linkage is the linkage mode that will be set when you place the feature (New, Duplicate or None). Linkage Read/Write will change the write permissions with the linkage. (Read/Write is the most common type.) Click the Update button to add the feature attribute definitions. Now we can associate MicroStation key-ins with the feature. Highlight the feature you just inserted and then click a data point in the lower left hand field under Command. Key in the name you wish to use for the command (like Draw Wetland Border). Enter the appropriate MicroStation key-in to the right of it (such as place lstring constrained). Click Insert to insert and associate this command with the highlighted feature.

Build additional categories and features as you wish, keeping in mind that a feature does not just have to be a line-it can be almost any MicroStation object. When the element type is selected in the Element Type menu, any other associated settings will appear in the lower right hand corner of the Feature Setup dialog box, when applicable. It is recommended that you enter multiple features with each category you add, so every object (feature) you place in your project is feature coded. You may highlight any entry in the Feature Setup dialog box, modify it and then click Update to make corrections to the feature
MicroStation GeoGraphics Workflows

7-13

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
tables in the database. When you are satisfied with your categories and features, click the Commit button, which will permanently write these entries into the database. If you have not clicked Commit, you can click Rollback, which takes you back to the point of your last commit.

Registering maps
Close the Feature Setup dialog box, as well as the Project Setup dialog box. So MicroStation GeoGraphics can discriminate between your different categories, you must now take the design files that you already prepared (like the sample wetlands.dgn) and rename them with the appropriate extension for the category in which you want them to be a part. If you want wetlands.dgn to be in the wet category, rename wetlands.dgn to wetlands.wet. Move your renamed map into your <project name>\DGN directory, so MicroStation GeoGraphics can locate it. Do this with all of your maps for which you have created categories. Open one of the maps with the new file extension as the active file in MicroStation GeoGraphics (such as wetlands.wet). Then go to Project > Setup to open the Project Setup dialog box. Make sure your project parent directory and project name directory are listed correctly and enter your ODBC data source name in Database Login field; then click the Open button to connect the database and project directories. Next, an index shape must be placed that will be used to find your map when attaching it with the Map Manager. This can be done on your own by using the MicroStation Place Block or Place Shape tools (note that the index shape must be a Type 6 object) or selecting

7-14

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
Miscellaneous > Create Map Shape > Design File in the Project Setup dialog box. The Create Map Shape tool calculates the outer limits of your graphics and places a shape around it. We can register this map into the MAPS and UGMaps tables by selecting Miscellaneous > Register Map > Design File.

To use Register Map, you must have: The project opened in Project Setup A category created that matches the extension of the current active design file opened A map shape created

Choose the Register Map tool, select your map shape and click your data point mouse button to accept. The status bar prompt will read Database keyin processed. Delete the map shape you created, as you no longer need it. It has been saved as an index shape in the file index.dgn from your \<project name>\IDX directory. You have successfully registered your first map in the MAPS and UGMap tables and added an index shape.

Instead of storing the map shape in an index.dgn file, you can


store the range information in the database. XLOW, XHIGH, YLOW and YHIGH columns must be defined in the MAPS table. For more information refer to the MicroStation GeoGraphics Users Guide. Raster images can also be registered in the MAPS and UGMap table with corresponding index shape. This allows the images to be attached with the Map Manager tool in the same way DGN files are attached. Image Manager is also used in the background to handle the raster attachment. Raster images must be registered through the Project Setup dialog box in a similar fashion as DGN maps. First, make sure the raster image(s) reside in the <project name>\DGN directory (this directory is used by default when attaching maps). Choose Project > Setup to open the Project Setup dialog box. Enter the correct project parent directory, project name directory, choose the database server and enter the database login. Click the Open button to connect the project. To verify youve successfully connected, the MicroStation status bar should read

MicroStation GeoGraphics Workflows

7-15

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
Database:<your database name>. The first step in registering an image (any map for that matter) is making sure that a category has been created that matches the map (image) file extension name. Choose Tables > Feature Setup. Insert a category that has uses the raster image file extension (i.e. Enter HMR, TIF, COT, etc. in the Extension field). Enter a category Name, specify index.dgn for the Index File, specify a level the index shape will placed on for Level. Make sure to turn on the Raster toggle; this specifies this is a raster image category. Only these fields need to entered for a raster image category; no feature creation for this category is needed.

Hit Update then Commit to save the changes. Close the Feature Setup dialog box, then choose Miscellaneous > Create Map Shape > Raster Image. This will bring up a Choose Image dialog box which will attach the raster image you choose via Image Manager, as well as create a shape element around the extent of the image.

Now choose Miscellaneous > Register Map > Raster Image and identify the image index shape element that was previously created. Accept with a data point to register the image in the Maps and UGMaps table, as well as link the index shape. If you receive an error that says Map Table: maps not found in mscatalog, this means you did not log into your project (i.e. enter login info in all Project Setup fields and click Open button). After it has been registered, you

7-16

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
can detach the image with Image Manager (Choose File > Image Manager), and delete the remaining image index shape.

The Vicinity map


Your key map, or vicinity map, will show up in Window 8 (labeled Key View) if you have Key Map toggled on in the Project Open dialog box. A vicinity map is a base map that encompasses the overall area where all of your registered maps are located. This could be a road map, township boundary map, quad map, etc. Be sure that your registered maps are located somewhere within the vicinity map. Rename the design file that will represent the vicinity map to vicinity.dgn and copy it into the \<project name>\IDX directory, overwriting the existing vicinity.dgn (blank file created from the seed file).

Configure the Project Directory and Project Name


MicroStation GeoGraphics uses two configuration variables to define the project directory path and the project directory name; these paths will automatically get entered in the Project Setup and Project Open dialog boxes. It is helpful to define these configuration variables to your project paths to avoid manually typing them in each time you either the Project Setup/Project

MicroStation GeoGraphics Workflows

7-17

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
Open dialog boxes. These variables are set to the Mytown sample data project directory by default. To configure these variables: Start MicroStation GeoGraphics. Open up any DGN file. From the Workspace menu, open Configuration. This opens the Configuration dialog box. Choose the All (By Level) category. Highlight MS_GEOPROJDIR and click Edit. This opens the Edit Configuration Variable dialog box. Replace the default Mytown path with your project parent directory and click OK. For example, if your project is in the d:\projects\mymaps directory, your project parent directory is d:\project\.

Now highlight the MS_GEOPROJNAME variable and click Edit. Delete MYTOWN and enter the folder name of your project subdirectory. For example, if your project is in the d:\projects\mymaps

7-18

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
directory, your project name directory is mymaps.

Click OK, then click OK again and click Yes to accept the changes.

Activating the project


After creating the basic project structure through Project Setup (category and feature creation, map registration, etc.), the MicroStation GeoGraphics projects are opened in an active session via the Project Open dialog box. Follow the steps below to activate the project. If you have the Project Setup dialog box open, close it. Go to Project > Open to invoke the Project Open dialog box. If your project directory is not listed in the Directory field, click Browse and locate it. The Export File field should be blank so you can connect to the database. Choose the appropriate database server (Microsoft Access via ODBC is used in this example, so ODBC is chosen). The
MicroStation GeoGraphics Workflows

7-19

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
Database Server option button allows you to choose which database type to use on-the-fly; it automatically defines the appropriate database variables upon activating the project. Toggle on Database Connect and Database Load. Enter your ODBC data source name in the Login field. The Work Map, Map Manager and Key Map options should all be toggled on. Click OK to log in.

A progress bar will appear, indicating that MicroStation GeoGraphics is loading the various database tables and map information for your project. After the progress indicator disappears, the vicinity map will display in Window 8 and MicroStation GeoGraphics will fit the map in the window. You can now attach any maps you have registered. Choose the Map Manager icon or choose Utilities > Map Manager.

The Map Manager dialog box will appear and the Tool Settings dialog box will contain different modes (see modes explanation below) for attaching maps. The Map Manager uses a list of registered maps from the MAPS table to attach DGN vector files or HMR raster files. For our example, use Point Mode, which will attach maps from the MAPS table according to whichever maps intersect the data point clicked in Key View (Window 8). Notice that when a data point that intersects the location of a map is entered in the Key View, the map index shape appears (outermost extent of the design file to be attached), indicating that a map has been selected. Its name also appears in the Map Manager dialog

7-20

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
box. You can now select the maps (hold down control key to multi-select) you want to attach/detach in the Map Manager dialog box. Map Manager options include: Detach - to detach the map Attach - to make the map a reference file Master - to make the map the active file Seamless - automatically attaches maps as reference files that only intersect with the active view window

MicroStation GeoGraphics Workflows

7-21

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
If youre not using Seamless mode, click Apply to open the design file(s) and choose Fit from the View Controls to display the map(s).

Map Manager Modes


The Map Manager offers five different modes for attaching maps. These five options appear in the Tool Settings dialog box when Map Manager is chosen. The following modes are: Point - only selects maps that intersect a data point entered in a view View - only selects maps that intersect a view window chosen by user Shape - only selects maps that intersect a shape element chosen by user Fence - only selects maps that intersect a fence placed by user All - lists all of the maps registered in the MAPS table for attachment/detachment, regardless of where they are positioned

Include Raster Images toggle - when this is turned on, MicroStation GeoGraphics will select any HMR raster image that's previously been registered in the MAPS table. The final two steps are crucial in making your project complete-attaching feature linkages and creating user attribute information.

Attaching feature linkages


Finally, youll want to attach features to existing elements and create and link user attribute information. Attach the map as your Master file that you would first like to start adding feature linkages to and detach any others. This will most likely be the map that fits into one of your categories that has a set of features associated. After the map is open, we can start attaching features. This can be done two ways-with the Feature tool box (using Select By Attributes to

7-22

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
speed attach operations if desired) or with Utilities > Best Feature Assignment, which opens the Attach Best dialog box. From the Utilities menu, select Feature Manager to open the Feature Manager dialog box Choose the desired category and select the desired active feature. Click Activate.

Choose the Attach Active Feature tool from the Features tool box

Select the element you want to attach the feature to; then accept with a data point.

Notice that the List Feature Attachments dialog box has opened, containing the category, code, and feature name of the newly attached feature. If you attach more than one feature to an element, the List Feature Attachments tool will list

MicroStation GeoGraphics Workflows

7-23

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
the features according to priority, with the highest priority feature being the first in the list.

Open the Display Manager From the Settings menu select Display Manager (or select the Display Manager Icon from the View Control)

Set the Mode to Feature Toggle on the features that youve displayed Click Apply then click Update. This will display the elements in the symbology of their feature coding.

Any elements that dont have feature coding will disappear-in this case, youll have to switch back to Level mode to do any manipulation. Level mode displays by the assigned level listed in the Feature table instead of by Feature linkage. Attaching a feature code actually creates a database linkage between the element and the Feature and UGFeature tables in MicroStation GeoGraphics. MicroStation GeoGraphics will then resymbolize the element according to the information in the Feature and UGFeature tables, instead of its original symbology. You may use the Attach Feature tool with selection sets

7-24

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
(Select By Attributes is very handy to speed/filter selection operations) or fences to speed up feature coding operations on elements.

Linking user attribute tables


Most projects require the ability to query on user attribute data that generates a graphical output on your map-a fundamental GIS operation. MicroStation GeoGraphics requires a certain database table structure for your data, as well as other system tables that must reference this information. The goal here is to associate (link) attribute information from a row in a database table to a feature in your map. To link a table row with a feature, you must first create an empty table structure to use, or take an existing populated table that you can modify for use with MicroStation GeoGraphics. For our example, create a new, empty table structure using Microsoft Access. Many of the table creation commands can be done through MicroStation with SQL statements or with the MSCATALOG dialog box tools; you may find it easier doing it in Access, as shown below. Open your project .mdb file in Microsoft Access. Click New to create a new table, and choose the design view. Columns can now be added to your table. MicroStation GeoGraphics requires two mandatory columns in user attribute

MicroStation GeoGraphics Workflows

7-25

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
tables-MSLINK and MAPID. MSLINK must be a unique, numeric, indexed column. MAPID must only be numeric; duplicates are allowed.

Add your first column, name it MSLINK, set the Data Type to Number and set the Field Size to Long Integer. Leave Decimal Places at Auto and the Default Value at 0. Change Required to Yes, and choose Yes (No Duplicates) for Indexed. Enter the next field name, MAPID, and set Data Type to Number with a Field Size of Long Integer. Decimal Places should be set to Auto and Default Value should be set to 0. Required and Indexed should be set to No. Add your user attribute columns as needed (owner, values, class, etc.). Be careful not to use reserved words or unacceptable characters for your column

7-26

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
names. Save changes when finished, give your table a name, and close the design view window to return to the Access tables listing dialog box.

Any user attribute table that is going to have a link to graphics in MicroStation must be documented in the MSCATALOG table. Double-click on the MSCATALOG table to open it into the datasheet view. Add a new row, enter your new user attribute table name in the Tablename column and give it a unique number in the Entitynum column-these two columns are mandatory; the others (such as sqlreview, fencefilter, etc.) are optional. Save changes and close to return to the Access table listing dialog box.

Now open the UGTable_Cat table, also known as the Table Catalog, in datasheet view. This table can also be populated through the Project Setup dialog box by going to Tables > Table Catalog. (We will populate this table in Access.) Type all entries in this table in capital letters. In the tname column, enter your user attribute table name. Under talias, enter an alias name for your table. Under pkey, enter the name MSLINK as the column used for the primary key. The descr field is for entering a table description, which is optional. The final column, ustn, flags the table in the Query Builder as to whether it linked to graphics or not. Enter 1 in the column if the table will be linked with graphics - although this is optional; the Query Builder will still function properly if this field isn't populated. Again, save your changes and exit to the Access Tables listing dialog box. If you are finished adding tables, exit Access. Why these tables and columns are neededMicroStation stores the MSLINK number (row) and Entity Number (table) with the element when adding a database linkage. When you query on the element in MicroStation, it goes back to the database to which youve connected and finds the table according to the entity number, and then it finds the row attached according the MSLINK number. This is why MicroStation needs the

MicroStation GeoGraphics Workflows

7-27

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
MSCATALOG table-to see what tables are linked to graphics and their assigned Entity Numbers. The MAPID column is a required field that tells MicroStation GeoGraphics what map you are working on. MAPID is taken from the MSLINK field in the MAPS table for the corresponding map you are working on. MAPID is used when you perform a Visual SQL Query Builder Locate, attaching maps with the Map Manager, etc.

UGTable_Cat is a table MicroStation GeoGraphics needs so it may recognize your user attribute tables for query building and general SQL queries. Since your table structures are created, youre ready to start populating rows and linking them to features. Load MicroStation GeoGraphics and open your

7-28

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
project via the Project Open dialog box. Attach the map to which you want to add database linkages as your Master file. Open the Visual SQL Query Builder dialog box (Database > Query Builder).

Database dialog box (Settings > Database). Make sure the Linkage Mode is set to New.

Create an active entity to populate the first row. At the Keyin Browser, key in an AE=<insert SQL statement>. The insert statement structure is as follows: INSERT INTO <table name> (<column name>)VALUES (<column data>)

AE stands for active entity, which is a temporary table MicroStation creates which contains a row of data that you specify either through the AE=

MicroStation GeoGraphics Workflows

7-29

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
statement, FI= statement, FIND statement, graphic definition tool, or through the suite of tools in the MicroStation GeoGraphics Visual SQL Query Builder. This row gets attached to an element you specify with the ATTACH AE command or with MicroStation GeoGraphics Visual SQL Query Builder tools. After you create the AE, you should get a prompt such as Database operation complete in the Status Bar, which means the AE has been successfully created. You can now attach the AE to an element, thereby linking it to the database. Key in ATTACH AE, select the element (feature) for the attachment and click a data point to accept. You have created your first user attribute linkage to a feature.

Adding user attribute database linkages to other elements using the Visual SQL Query Builder Choose the Review Attributes tool from the main tool frame and select the feature with the user attribute linkage. The information linked to this feature should be retrieved from the database and display in a built-on-the-fly database form (this functionality is part of the Visual SQL Query Builder).

7-30

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
The following graphic shows a built-on-the-fly database form from Review Attributes.

You can now use this first row as a seed row and let MicroStation GeoGraphics automatically build the AE. Make sure the Database dialog box Linkage Mode is set to New. Select any database value(s) from the database form and change them as desired. After you are satisfied with your changes, click the Attach button. Select the feature to attach the linkage to, and follow with a data point to accept. The Attach button will insert a new row (with the changes you've made in the form) as well as attach or link the information to the feature. To verify youve inserted and attached the new row, dismiss the current database form, then choose Review Attributes. Select the feature you just attributed, and follow with a data point to accept. The updated information with new mslink number assigned will appear in the form.

You can repeat the Review Attributes/database form steps for populating rows and attaching them to elements. There is no need to use the AE= key-in again until you begin linking a new, empty table. Already populated user attribute tables can also be used; the only requirement is that they have the MSLINK and
MicroStation GeoGraphics Workflows

7-31

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
MAPID columns. The MSLINK column should be populated with unique, numeric values. You can then use the Duplicate Linkage Mode from the Database dialog box to attach rows. Set the Database dialog box Linkage Mode to Duplicate. Build the query in the Visual SQL Query Builder and hit Execute. A database form will appear with the query result. Click the Attach button and select the element to attach it to.

To complete the user attribute tables, the MAPID column must be populated. MAPID is taken from the MSLINK field in the MAPS table for the corresponding map on which you are working. MAPID is used when you perform a SQL Manager Locate, attaching maps with the Map Manager, etc. We can populate

7-32

MicroStation GeoGraphics Workflows

Workflow 7: How do I create a MicroStation GeoGraphics project that I can organize my existing data in?
this field quickly with the FENCE UPDATE MAPID key-in or use the Fence Update Mapid tool from the Maps tool box.

To use this command you must: Make a map the Master file with the linkages you want to update for the MAPID column. Place a fence around the map. Key in FENCE UPDATE MAPID (or use the Fence Update Mapid tool) and click the data point on your mouse to accept.

MicroStation GeoGraphics should update the MAPID column with the appropriate number for the Master map. Use the Review Attributes tool on a feature to ensure that the MAPID column has been updated. Correct project setup optimizes the efficiency and functionality of MicroStation GeoGraphics as a engineering/GIS solution. As you continue to build projects over time, these rules will become second nature. Learning to implement these guidelines will ensure success when organizing mapping data for use with MicroStation GeoGraphics.

MicroStation GeoGraphics Workflows

7-33

7-34

MicroStation GeoGraphics Workflows

You might also like