Drawings SDK Developer Guide > Working with .dwg Files > Working with Entities > Working with Specific Entitites > Working with Arc-Aligned Text > Example of Working with Arc-Aligned Text
Example of Working with Arc-Aligned Text

Sample files for working with arc-aligned text are located in the Drawing\Examples\DevGuide\OdArcAlignedTextEx subdirectory of the ODA installation folder (for example, C:\Program Files\Open Design Alliance).

The example demonstrates displaying and modifying the properties of an arc-aligned text object. In the main function an arc entity is created with initial values of center, radius, start angle and end angle parameters. After that an arc-aligned text entity is created and connected with the arc entity that was created and added previously to a database. To set the text string for arc-aligned text, use the setTextString() method. The center, radius, start angle and end angle properties will have the same values as the arc entity. Other properties will set as default values.

After that another arc entity is created to demonstrate how to change properties of the arc-aligned text entity. This arc object has the same values of radius, start angle and end angle but its center coordinates are moved along the X-axis. The second arc-aligned text entity is created and connected with this arc entity. To change the property's value of a new arc-aligned text object, use setTextString(), setXScale(), setTextPosition(), setTextSize(), setTextDirection(), setOffsetFromArc(), setUnderlined(), setAlignment(), setColor(), setCharSpacing(), reverseCharOrder() and setFont() methods.

The next step is to display on the console the default values and the changed values of the properties of two arc-aligned text entities using the printArcAlignedTextProperties() function.

The printArcAlignedTextProperties() function requires a pointer to an existing arc-aligned text object and displays its specific properties. The function gets the specific properties using the textString(), xScale(), textSize(), offsetFromArc(), charSpacing(), isReversedCharOrder(), textPosition(), color(), textDirection(), isUnderlined(), alignment(), font(), center(), radius(), startAngle(), and endAngle() methods.

See Also

Working with Arc-Aligned Text

Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.