LA Solutions staff have written a number of technical articles. These include programming, MicroStation®, GeoGraphics™, and relational databases. Some articles describe aspects of MicroStation software development, and others provide code examples.
You may also find the BE Newsletter useful. It is published by Bentley Systems.
This page provides an index to publications having the following topics …
| Title | Article Location | Notes |
|---|---|---|
| Windows File Associations and MicroStation | File Associations Page | |
| MicroStationDGN.Application Automation Server | Automation Server Page | Windows Registry Modification |
| Windows Shortcuts and MicroStation | PDF Document | CAD Administration |
| Windows Thumbnails and MicroStation | Bentley Discussion Group | Windows Registry Modification |
Windows Help (.chm) Files won't display over netwokr |
Fixing HTML Help over networks | Windows Registry Modification |
| Title | Article Location | Notes |
|---|---|---|
| Command Line Switches | Web Page | |
| Element Display Order | Web Page | |
| Reference File List | Ask Inga | There is an alternative described here |
MicroStation's configuration variables (CfgVars) are like system
environment variables that are visible only within MicroStation.
MicroStation uses CfgVars extensively to define
its working environment. You can benefit from this by using CfgVars
wisely. The best place to ask questions about CfgVars
is the bentley.microstation.administration newsgroup in the
Bentley Discussion Groups.
CfgVars are defined in the various user (.ucf),
project (.pcf), and system (.cfg)
configuration files that you will find in the \Bentley\Workspace
folder and in the \Bentley\Program\MicroStation\config folder.
Bentley Systems continue to add new configuration variables to Microstation. This page on the Bentley web site lists new variables.
Another Bentley web page lets you review configuration variables in Microstation V8 2004 Edition.
There is plenty of information about CfgVars in the MicroStation documentation, and the articles mentioned below provide some additional hints about examining and debugging CfgVars.
| Title | Article Location | Notes |
|---|---|---|
| Beginner's Guide to Project Configuration | Project Configuration | |
| Debugging Configuration Variables | Debugging CfgVars | |
| Validating Configuration Variables | Configuration Validator | VBA project with source code |
| File & Folder Information | Files & Folders | |
| Project Folder Creation | Hidden CfgVars Simplify New Project Creation | |
| Working Directory and Configuration Variables | Working Directory and Configuration Variables |
| Title | Article Location | Sample Code |
|---|---|---|
| Advanced MicroStation Detector | MicroStation Detector DLL | MicroStationDetector ZIP Archive |
| File & Folder Browsing | Files and Folders | Example VB and VBA code available |
| MicroStation V8 Database Connectivity | ZIP Archive | ZIP archive includes article & code sample |
| Controlling MicroStation V8 with Visual Basic | ZIP Archive | ZIP archive includes article & code sample |
| Simple MicroStation Detector | PDF Document | MicroStationDetector VBA Source |
| Text Wrap | VB Project for Text Wrap and Justification | VB Project in ZIP archive |
| Viewing Thumbnails | Viewing File Thumbnails | Viewing File Thumbnails |
We've written a miscellany of VBA tips, plus some longer articles listed here.
MVBA is Bentley Systems' adaptation of the Microsoft VBA toolkit. It provides a subset of Visual Basic™ (VB) functionality and is similar to the VBA implementations in Microsoft Word™, Excel™ and applications from third-parties.
Where MVBA differs from other VBA implementations is its support for MicroStation. Just as VBA for Word provides programming models for words and paragraphs, MVBA provides programming models for graphic elements, reference models, keyin commands, and many other features unique to MicroStation.
MVBA uses VB syntax and is easy to learn: there are many books and other tutorials available for Visual Basic beginners. The Interactive Design Environment (IDE) is similar to the IDE in Word and Excel, and not too disimilar to the IDE in VB itself.
VBA includes debugging tools. The Debug object is your friend.
One irritating failing of VBA, and Visual Basic as well, is its lack of support for a mouse wheel. That is, you can't use the wheel on your mouse to scroll through code in the VBA IDE. However, Microsoft has published a fix for this problem. Visit this link to learn how to enable mouse-wheel scrolling in both VB and VBA.
| Topic | Title | Article Location | Sample Code |
|---|---|---|---|
| Administration | Configuration Variables | Configuration Variables and VBA | Configuration Variables and VBA |
| Databases | Databases | Databases and MicroStation | |
| Element Manipulation | Create a Shape Element | Create Shape Page | CreateShape.zip |
| Move an Element | Move Element Page | MoveElement.zip | |
| Events | Design File Events | Design File Events Page | OpenCloseEventHandler.zip |
| GeoGraphics | Find Maps about a Point | GeoGraphics Page | |
| Levels | Level Control & Manipulation | Level Control | Source code included |
| Iterating Level Libraries (DGNLIBs) | Level Libraries | Source code included | |
| Measurement | Measure Area of Closed Shapes, Grouped Holes & LineStrings | Measure Area page | Contained in article and MeasureArea.mvba module |
| Measure the Length of a MultiLine | Measure Lines page | Contained in article | |
| Measure the Distance Between Parallel Lines | Measure Lines page | Contained in article | |
| Computing Intersections | PDF Document | ComputingIntersections.zip | |
| Miscellaneous | Navigating the TCB | Navigating the TCB Page | |
| Clipboard: Cut and Paste with VBA | Using the Windows Clipboard | Source code included | |
| Arithmetic: truncation & rounding with VBA | Numeric Formatting | ||
| Is an MDL Application Loaded? | Is MDL Loaded Page | Source code included | |
| Is an element a Grouped Hole? | Grouped Hole Page | Source code included | |
| MicroStation VBA Tips | MVBA Tips Page | Contained in article | |
| Referencing the MicroStation VBA Object Library elsewhere; referencing other libraries in MicroStation VBA | Referencing VBA Object Libraries | Included in article | |
| Using MicroStation's Message Center | Message Center Page | Contained in article | |
| Starting a Batch File | PDF Document | ShellBatch.zip | |
| Validating Configuration Variables | Configuration Validator | ||
| Verifying a DGN File | Check Design File Page | Sample code that shows how to check if a file is a DGN file | |
| References | Log Reference Attachments | PDF Document | LogRefs.zip |
| Attach Reference | Attach Ref Page | AttachRef.mvba | |
| Scanning | Searching through a Model for specified elements | Scanning a Model | Included in article |
| Enumerating Models or Cells | Enumerating Models page | How to examine the models in a DGN file (a model is a cell; a cell is a model) | |
| Tags | Reading and Writing Tag Data | Tag Data Overview | Included in article |
| Writing Tag data into a Text File | PDF Document | TextFileWriter.zip | |
| Text | Text Element Analysis & Manipulation | Text Element Page | |
| Reading a Text File into Coordinates | PDF Document | TextFileReader.zip | |
| Views | MicroStation View Capture | Capture View Page | CaptureView.zip |
| View Settings and Control | View Settings and Control Page | ||
| Windows | File & Folder Browsing | Files and Folders | Example VB and VBA code available |
| Open an Office Document | Open a Word™, Excel™ or other document in MicroStation | ||
| Progress Bar | Progress Bar Article | ProgressBarExample.zip | |
| Windows Common Dialogs | Common Dialogs Page | Contained in article |
MicroStation can link to an external relational database. For example, it's common practise to store non-graphic data in Oracle®, SQL Server®, or Access®. A DGN file can also be viewed as a database, since attribute data, tags, or XML fragments can be attached to graphic elements.
There's more information about MicroStation and databases.
MDL is the most flexible way of developing applications for MicroStation, and Bentley Systems use it themselves. It is an implementation of ANSI C, with many extensions to match its capabilities to MicroStation's complex feature set.
You can create an MDL application using just the developer tools provided with MicroStation. However, a more productive route is to use Microsoft Visual C++™ VC++ to create a DLL. Your VC++ code can call MDL functions just as you can call Windows Win32 API functions. Real benefits of this approach are the VC++ IDE and debugger, the productivity gains of writing C++, and use of the Standard Template Library (STL).
| Title | Article Location | Sample Code |
|---|---|---|
| Custom Menus with MDL | MDL Menus Page | Contained in article |
| Database Linkages Explained | Database Linkages Page | |
| Dialog Manager API (all you need to know about access strings but were afraid to ask) | Dialog Manager Page | Contained in article |
| Examples | Bentley Systems' Example Links | |
| Element & Descriptors | Element & Descriptors | |
| ElementRefs | ElementRefs | |
| Levels and MDL | MDL Levels Page | Contained in article |
| Graphic Groups and C++ | MDL Graphic Groups Page | Contained in article |
| Localised Date, Currency, and Numbers | MDL Locale | How to format a data string in your country's style |
| ListModels and Editors | ListModels Page | Contained in article |
| Locating Objects with MDL | MDL Locate Page | Contained in article |
| Measuring Objects with MDL | MDL Measurements Page | Contained in article |
| Memory Management in Native Code | Memory Management Page | Contained in article |
| Message Center for Developers | Message Center Page | Contained in article |
| Migrating Dimension Code to MicroStation V8 | Bentley Technote | See also MDL Help Documentation |
| Open a File with Associated Application | Associated Application Page | |
| Process Fence Contents using mdlFence_xxx or Scan Functions | Process Fence Contents | |
| Search for an Element by its ID | Scan for Element ID | |
| SnapMode | Find how to get and set the current MicroStation snap mode | |
| Stroke an Element | Convert an element to a line string or shape | Stroke.zip |
| Typedefs, structs, and Compiler Errors | The Compiler issues an error when I attempt to use an MDL structure | |
| Undo Grouping and C++ | MDL Undo Group Page | Contained in article |
| Visual Studio and MDL | Using Visual C++ to build an MDL application DLL | |
| Windows and MDL | Set up your Windows environment to build an MDL application | |
| XML Code Generator for C & MDL | XML Struct Page | XML Struct ZIP archive |