Complex Linetype Codes Explained: A, R, U, S, X, and Y Parameters
Complex linetype descriptors use compact transformation codes to place text or an SHX shape along the pattern. The most important codes are A, R, U, S, X, and Y, but the letter A has two different meanings depending on where it appears.
This reference assumes you already understand the basic LIN file structure and the conceptual difference between simple and complex linetypes.
Anatomy of a Complex Linetype Descriptor
Text Descriptors
A text descriptor begins with a quoted string and a text-style name:
["GAS",CADLT,S=.10,U=0.0,X=-.10,Y=-.05]
Shape Descriptors
A shape descriptor begins with the shape name and compiled SHX filename:
[TREE,cadlt.shx,S=.15,R=0.0,X=-.075,Y=-.075]
Parameter Order and Separators
Descriptor fields are comma-separated inside square brackets. Use an equals sign between each transformation letter and its value. Keep a consistent order—rotation, scale, X, then Y—to make reviews easier.
The A Alignment Code
What A Alignment Controls
The leading A appears at the beginning of the complete pattern line:
A,.50,-.20,["GAS",CADLT,S=.10,U=0.0],-.25
It selects the aligned linetype pattern behavior. It is not inside brackets and is not followed by an equals sign.
Why It Appears at the Beginning of the Pattern
The token applies to the entire repeated definition. AutoCAD uses aligned placement so ordinary lines begin and end with a drawn portion where possible.
The A Absolute Rotation Parameter
Absolute Rotation Relative to the World Coordinate System
Inside a descriptor, A= specifies an absolute angle. The embedded component is oriented relative to the drawing coordinate system rather than simply following the line.
How A= Differs from the Leading Alignment Code
A at the start of the pattern selects alignment. A=0.0 inside brackets controls component rotation. Treating them as the same code is a common documentation and troubleshooting mistake.
When Absolute Rotation Is Appropriate
Use absolute rotation when a symbol must remain tied to a fixed drawing direction. It is less suitable when a symbol or word should follow a route that turns through several angles.
The R Relative Rotation Parameter
Rotation Relative to the Line
R=0.0 aligns the component with the local line direction. An additional angle rotates it relative to that direction.
Positive and Negative Angles
Positive and negative values rotate in opposite directions. Test a known horizontal line first, then vertical and diagonal lines, so the sign convention is clear in the selected CAD product.
When R Causes Reversed Text
Because the component follows object direction, a line drawn from right to left can make text appear upside down. Use U= for labels that must remain readable or see the text-orientation troubleshooting guide.
The U Upright Rotation Parameter
Keeping Text Readable
U=0.0 is commonly used for repeated utility words. It allows the component to follow the path while attempting to keep its reading orientation upright.
How U Differs from R
R preserves strict orientation relative to the object direction. U prioritizes upright readability. The result can differ on reversed lines, arcs, and closed curves.
When to Use U Instead of R
Choose U for words and non-directional labels. Choose R for arrows, ticks, or graphics whose orientation must follow the path. Test both modes before approving a standard.
The S Scale Parameter
Scaling Text
S= controls the size of the embedded string relative to its referenced text style. A zero-height, non-annotative style gives the most predictable tuning.
Scaling SHX Shapes
For a shape descriptor, S multiplies the compiled shape’s design size. Record the nominal source size so future editors can understand why a particular scale value was selected.
Relationship with the Source Text Style or Shape
S does not operate in isolation. The style’s font and height or the shape’s original design size affect the result. The complete line is also subject to LTSCALE and object-scale settings.
The X Horizontal Offset Parameter
Moving Text Along the Pattern
X shifts the component along its local baseline. A negative value often moves the word backward so it is centered in the blank distance reserved before the descriptor.
Creating Space Before and After a Symbol
Use numeric gap descriptors to create the main blank space. Use X only for fine alignment; a large offset can make the pattern difficult to maintain and can overlap another cycle.
Using Positive and Negative X Values
Test the sign on a horizontal line. Record whether positive moves the component toward the line’s end in the chosen orientation, then verify the same definition on reversed geometry.
The Y Vertical Offset Parameter
Positioning Text Above the Line
A positive or negative Y value—depending on local orientation—can lift the text away from the stroke. Use a small controlled offset so the word still reads as part of the line.
Positioning Text Below the Line
Reverse the sign to move the component to the opposite side. Test reversed lines because “above” and “below” are local to the component orientation.
Aligning Symbols with the Line Center
If the shape origin is at a corner, Y and X can recenter it, but rebuilding the shape with a better origin often produces cleaner code.
How the Parameters Work Together
Parameter Evaluation Order
Think of the descriptor as selecting the component, orienting it, scaling it, and then positioning it. Keep the written order consistent even when the parser accepts another order.
Rotation and Offset Interactions
X and Y operate in the component’s local system. Changing rotation can therefore change the visible direction of an existing offset. Retest placement after every rotation change.
Scale and Spacing Interactions
Increasing S enlarges the component but does not automatically increase the gaps around it. Adjust the neighboring negative values to preserve white space.
Complete Text Descriptor Example
Original Code
["GAS",CADLT,S=.10,U=0.0,X=-.10,Y=-.05]
Parameter-by-Parameter Explanation
"GAS": repeated string.CADLT: required text style.S=.10: text component scale.U=0.0: upright orientation.X=-.10: horizontal adjustment.Y=-.05: vertical adjustment.
Modified Variations
Use a larger S value for a larger word, change U to R when the word must follow line direction exactly, or alter X/Y in small increments. Reload and regenerate after each revision.
Complete Shape Descriptor Example
Original Code
[TREE,cadlt.shx,S=.15,R=0.0,X=-.075,Y=-.075]
Parameter-by-Parameter Explanation
The descriptor selects TREE from cadlt.shx, scales it, follows the line direction, and shifts the symbol so its visual center sits on the pattern path.
Modified Variations
Switch to absolute orientation for a fixed-world symbol, change the origin in the SHP source to reduce offsets, or create a separate shape variant instead of using extreme transformation values.
Quick Reference Table for A, R, U, S, X, and Y
| Code | Role | Main caution |
|---|---|---|
A |
Leading pattern alignment. | Not the same as A=. |
A= |
Absolute component rotation. | Tied to drawing coordinates. |
R= |
Relative rotation. | Can reverse text with object direction. |
U= |
Upright rotation. | Best tested on curves and reversed lines. |
S= |
Component scale. | Does not replace linetype scale. |
X= |
Horizontal offset. | Acts in the local rotated system. |
Y= |
Vertical offset. | Acts in the local rotated system. |
A Reliable Workflow for Tuning Complex Linetype Codes
- Start with one long horizontal test line.
- Load a definition with simple spacing and no extreme offsets.
- Set rotation mode first.
- Set component scale second.
- Adjust X and Y in small increments.
- Retest reversed, vertical, diagonal, and curved objects.
- Check short objects, model space, layouts, and PDF output.
- Record the final style, font, SHX, unit, and scale dependencies.
