Align Text to Curve

Function Syntax ATC
Current Version 1.2
Download AlignTextToCurveV1-2.lsp
View HTML Version AlignTextToCurveV1-2.html
This program is also available at the Autodesk Exchange App Store

Program Description

This program enables the user to dynamically align a new or existing Text or MText object to a selected curve, with intuitive placement controls available at the command-line.

Upon issuing the command syntax ATC at the AutoCAD command-line, the user is prompted to select a Text or MText object to align. At this prompt, the user also has the option to create a new Text or MText object, or configure the program settings.

If the New option is chosen, the user is further prompted to enter the content for the new text object, or may press Enter to return to the previous prompt.

If the Settings option is chosen, the user is presented with a dialog interface through which several program parameters may be configured - these settings are detailed in the section below entitled: Program Settings.

The user is then prompted to select a curve to which the text will be dynamically aligned. The program is compatible for use with Lines, LWPolylines, 2D (Heavy) Polylines, 3D Polylines, Arcs, Circles, Ellipses, Elliptical Arcs & Splines; furthermore, these objects may be primary or nested (to any depth) within a block or xref.

Finally, the program will perform successfully under all UCS & View settings and with Annotative Text Styles.

Dynamic Text Alignment

Following valid selection of a curve, the new or existing Text or MText object is dynamically aligned to the curve based on the position of the AutoCAD cursor.

During text alignment, several controls are available at the command-line to refine the text position & other properties, such as rotation; these controls are individually detailed below:

Text Alignment Controls
Key Action
Enter (or Esc/Space/Right-Click) Exit program (Cancel)
Click Place text
+ / - Incrementally increase/decrease text offset
O / o Specify exact text offset
< / > Rotate text by 45°
R / r Specify exact text rotation (relative to curve)
Y / y Toggle text readability
B / b Toggle MText background mask

Program Settings

Upon selecting the Settings option when prompted, the user is presented with the following dialog interface:

Settings Menu

Each of the above options are described individually below:

Object type for new text

This setting determines whether the program will create a single-line text (DText) object or multiline text (MText) object when the user opts to create new text.

Justification for new text

This setting controls the justification of any new text object created by the program.

Text Offset Factor

This is the default offset factor controlling the minimum distance of the text from the selected curve, as a multiple of the text height. This factor may also be zero if the text is to be positioned directly over the selected curve.

Text Rotation

This setting controls the default rotation of the text relative to the selected curve.

Text Readability

This toggle determines whether the text should be rotated to preserve readability, i.e. if enabled, the text will never appear upside-down.

Background Mask

This toggle controls whether a background mask is used when aligning MText objects.

Multiple Text Mode

If this setting is enabled, the program will continuously generate text objects to align with the selected curve until the user exits the program.

Program Demonstration

Align Text to Curve Demonstration

Instructions for Running

Please refer to How to Run an AutoLISP Program.


increase · reset · decrease

Designed & Created by Lee Mac © 2010