Q How can I align new text with an existing element, such as a line?

Questions similar to this, posed by MicroStation users and VBA developers, appear on the Be Communities MicroStation Forum or Programming Forum.

A This VBA project implements a tool for placing text in a DGN model. The tool first asks the user to identify a line element. Then it prompts the user to place a text element. The rotation of the text element is calculated to align with the line.

Introduction

MicroStation users sometimes want something different from the set of tools provided in the product.

The question asked, on Be Communities, was: "How can I use VBA to create a tool to place text along a line?"

Place Text Along

VBA

The Place Text Along tool is implemented using two VBA classes that implement a state machine interface …

clsLinePicker lets user pick a DGN element, such as a line. It calculates the orientation of that line. Then it starts clsTextPlacer, passing information about the line and the new text.

The macro lets the user choose the text alignment …

Download the Place Text Along VBA Project

Download PlaceTextAlong.ZIP

The code described is available in a MicroStation VBA project. The macro is provided as freeware with no guarantee of suitability for any particular purpose. Use at your own risk. We grant you a zero-cost license to use this software.

Unpack the ZIP archive and copy PlaceTextAlong.mvba to a location where MicroStation can find it. A good place to copy it would be \Workspace\Standards\macros. To start the macro, use the following MicroStation key-in …

vba run [PlaceTextAlong]modMain.Main

Questions

Post questions about MicroStation programming to the MicroStation Programming Forum.