Sheridan College
Architectural Technology
CADD12384 - CAD Customization
AutoCAD Linetype Customization
Linetypes are not usually in AutoCAD when you start a new drawing. There can be an indefinite number of linetypes, therefore AutoCAD does not come with the linetypes preloaded into the drawing. Rather, you have load them yourself.
The default linetypes that come with AutoCAD are stored in the ACAD.LIN or the ACADISO.LIN files in the support directory. These .LIN files are Linetype library files, or simply a collection of linetype definitions in ASCII (text) format.
The ACAD.LIN file is automatically used when an AutoCAD drawing is started with English units settings; ACADISO.LIN is used when an AutoCAD drawing is started metric settings. The two files contain the same linetypes, but the ACAD.LIN file's linetypes are defined in inches while the other is in millimeters. An excerpt of both files is shown below.
A linetype is defined by two lines of code:
*name,
description
A, linetype code
Looks simple, and it is. In more detail:
Name: The name of the linetype.
Description: The text description of the linetype: this description will appear when the linetype is listed on the text screen. However, it does not appear when looking a the linetypes in a dialogue box...
Linetype code: This is the real description of the linetype. Here a series of numbers will define the linetype:
A + (positive) number indicates a dash.
A - (negative) number indicates a gap.
A 0 (zero) indicates a dot.
Using these codes, we can assemble a linetype of any shape based on dots and dashes. For example the following linetype:
*cust1,
This is a cust sample linetype
A, +0.5, -0.25
Indicates a simple dashed line, with the dashes being 0.5 units long and the gaps being 0.25 units long.
You can simply add the above two lines to the ACAD.LIN file using a text editor, then load the linetype into a drawing file and try it out...
One common misconception is the fact that you have to use the ACAD.LIN file. You don't have to. You can create a new file with a name of SITE.LIN and put in as many linetypes in that file as you want. You can easily create various libraries this way....
There are some restrictions to the number of codes in a linetype code, the number of characters on each line (AutoCAD will only read the first eighty characters)...
Here's another example of a linetype:
*CUST2,
---- - . ---- - . ---- - . ---- - .
A, .5,-.125,.25,-.125,0,-.125
Note that in order to save space on the linetype code line, you can omit the leading zero and the plus symbol in front of the numbers. For example, "+0.125" and ".125" are the same.
Adding text:
You can easily add text in a linetype. Instead of one of the numbers, use the following code:
["TEXT", STYLE, S=nnn, R=nnn, A=nnn, X=nnn, Y=nnn]
Where:
"TEXT" is the text to be displayed on the linetype.
STYLE is the text style to be used. It is recommended that you keep this "Standard".
S is the Size of the text, basically its height.
R is the Relative angle of the text, relative to the line itself. If R is set to zero, then the text will be parallel (aligned) with the line.
A is the Absolute angle of the text, relative to the X axis. This option is rarely used; most of the time the relative angle will be used instead. Note that you can only use one of the two: A or R.
X is the X offset of the text insertion point parallel to the line. Use this field to control the distance between the text and the previous pen-up or pen-down stroke. Normally you will have to experiment with the linetype to get the offset just right.
Y is the Y offset of the text insertion point perpendicular to the line. This is used to control the vertical alignment of the text with respect to the line. Normally this value is negative and half the text size (this way the text appears centered vertically on the line).
There are two good examples of this type of linetype in the standard AutoCAD linetype libraries. For example, the next two linetypes are from the ACADISO.LIN file:
*HOT_WATER_SUPPLY,Hot water supply ---- HW ---- HW ---- HW ----
A,12.7,-5.08,["HW",STANDARD,S=2.54,R=0.0,X=-2.54,Y=-1.27],-5.08
*GAS_LINE,Gas line ----GAS----GAS----GAS----GAS----GAS----GAS--
A,12.7,-5.08,["GAS",STANDARD,S=2.54,R=0.0,X=-2.54,Y=-1.27],-6.35