Questions similar to this appear on the Bentley Discussion Groups. This question was posted to the MicroStation Programming Forum.

In normal operation, a MicroStation operator would place text elements so that the text is legible and clear. However, when text is imported from another application — another CAD tool or GIS product — then text elements may not be created in a way that is useful to a human.

Here's an example of text imported from a well-known GIS product. Multiple text elements are created at the same point, so that they overlap …

Scrambled Text

Unscramble Text Elements

We wrote some VBA code to help with this problem. The VBA project is available to download. The project includes the VBA source code.

The VBA macro looks for text elements in a MicroStation selection set or fence. The MicroStation operator must either place a fence around the text elements to be unscrambled, or select those elements.

If the collection of text elements has at least two members, the code chooses the origin of the first text elements as an anchor. It moves subsequent text elements to that anchor, then offsets each element by an appropriate Y distance. The result of running the code is legible text …

Unscrambled Text

Download the Unscramble Text VBA Project

Download a ZIP package that contains the UnscrambleText.mvba project …