Website Name - an official New Hampshire Government website
Smaller text size Reset text size Larger text size
link to website translation page
CAD/D HomeMicroStationMXOpenRoadsDownloadsSearchNHDOT Homelink to website translation page

MicroStation Macros

A number of macros have been created for use in MicroStation. Descriptions of some of the more useful ones are listed below. BASIC macros can be run by selecting Macro, then MicroStation BASIC from the Utilities menu.


Replaced by a VBA program.


Used to delete zero-length lines ("measles").


Used to delete zero-length lines ("measles").


Used to change the scale of all linestyles on the drawing. A dialog will display prompting you for the scale. Enter a scale and click on Ok. Click cancel if you would like to exit the macro without changing the line styles in your drawing.


Used to measure distances. This macro takes 2 data points from the user and calculates horizontal distance, vertical distance, slope distance and slope between the points. The basis for these calculations - horizontal is considered in the x-y plane and vertical distance is the difference in z coordinates. Be sure Active Depth is Off.


Used to replace points with a cell. Primarily for shape file imports that contain points. First bring up the cell selector and select a cell to make it current. Next use Element selector or define a fence to select all the points to be replaced. Run the macro by selecting Utilities > macros > basic macros and select pnt2cel and run.


This macro is intended to automatically run upon opening a dgn by adding the following two commands to the project's .pcf file.

GEO = 8329

It attaches the Geographic Coordinate System to the dgn's opened model. The GEO variable defines which GCS to use of the four different alternatives available for State of NH projects. The first two digits of the GEO variable define the horizontal datum (either 83 or 11 for NAD83 or NAD83/2011) and the final two define the vertical datum (either 29 or 88 for NGVD 1929 or NAVD 1988). Change the "GEO =" to the appropriate number provided by the Survey Section.

Slope and SlopeSet

Used to add slope text to profiles and cross sections. This macro measures slope between 2 data points and issues the place text above command to label the slope.

  • The text settings must be set before running the macros (generally either option 4 - x:1 or option 2 - x%) and precision [0 (0), 1 (0.0), 2 (0.00) etc.). Here the vertical exaggeration for profiles can be set also.
    slope settings dialog box
  • Now run Slope macro. Choose two points and hit on the element (the macro issues the Place Smartline command - but this is just a temporary line that the macro deletes). The macro will center the text above the element.
  • The Slope macro has to be invoked again to label the next slope. (The SlopeSet macro only has to be run once per session unless you need the format or precision changed.)
  • Note: If you receive error 1102 (Execution failed at line 40), two things could have happened.
    1. Check your preferences - Workspace > Preferences > Look & Feel. The default tool cannot be set to None.
    2. This can happen if you try to start the macro while it is already running.


This documentation describes a set of routines developed by Rowse Company (now ProSoft) to:

  • plot a cell at a specified station and offset
  • annotate a bound or property corner
  • give the station and offset of a selected point

See Station & Offset Programs for more detail.



Used to exchange a Reference file to the Active file. This macro prompts the user to select an "object" or element on the Reference file that is to become the Active file and Accept. If there have been any changes to the Active file, the user will be prompted to either save or not save the Active file changes before the macro exchanges the Reference file to be the Active file. This macro is also found as Function Key - Shift F7. At this time, xdelem will not work if the NHREF macro has been executed to attach reference files.

* - Yes, the delpoints and delpt macros appear to do the same thing. We don't know which one works better - so until we have good test case - we will keep both.

New Hampshire Department of Transportation
PO Box 483  |  7 Hazen Drive  |  
Concord, NH  |  03302-0483
Tel: 603.271.3734  |  Fax: 603.271.3914