AutoCAD Linetypes - Part 2
Simple Linetype Definition
The AutoCAD linetype syntax is pretty simple. Referring back to Part 1, recall the linetype definition that I copied, edited, and named MY-DASHED.
Looking at the definition, the first item is an asterisk, followed by the name of the linetype, then a short description, and finally an ASCII representation of the linetype. This last part is totally up to you, just get it as close as you can. Look at some of the other linetypes as a reference.
On the second line is where the guts of the linetype are actually defined. Start with an "A", then a comma. Next comes a positive numeral that represents the starting dash length, followed by a negative numeral to represent a space segment (or pen up condition). In my example above, the dash segment is 0.4 units long followed by a space of 0.35 units. Also notice that my example ends here. So what happens? AutoCAD just repeats the linetype definition over and over. You get a 0.4 unit long dash followed by a 0.35 unit long space, followed by a 0.4 unit long dash followed by a 0.35 unit long space and so on.
You can enter more than 2 segments. Take a look at your stock ACAD.LIN file and look at the PHANTOM2 linetype. It is composed of 6 segments.
*PHANTOM2,Phantom (.5x) ___ _ _ ___ _ _ ___ _ _ ___ _ _ A,.625,-.125,.125,-.125,.125,-.125
Complex Linetype Definition - Text Based
Moving on to complex linetypes, let's look at Text based linetypes first. The general syntax is the same as a simple linetype, but where you want to insert text you must use this syntax
The first item is the Text characters themselves, such as "GAS". Next comes the text style name, the scale, rotation, and any X or Y offset. A completed linetype definition might look like this:
*GAS_LINE,Gas line ----GAS----GAS----GAS----GAS----GAS----GAS-- A,.5,-.2,["GAS",STANDARD,S=.1,U=0.0,X=-0.1,Y=-.05],-.25
So we start off with the "A", then a 0.5 unit long dash, followed by a 0.2 unit long space followed by the text "GAS", then followed by a 0.25 unit long space. Then the pattern repeats starting with the 0.5 unit long dash again. You generally put a space on both sides of your Text. Consult the AutoCAD Customization Guide for specifics. For example, there are three available "rotation" parameters. U = plan readable, R = relative to the line, and A = absolute rotation.
Complex Linetype Definition - Shape Based
Shape based linetypes are similar to the Text based ones with one exception. Instead of a text string, you use the shape name.
*BATTING,Batting SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS A,.0001,-.1,[BAT,ltypeshp.shx,x=-.1,s=.1],-.2,[BAT,ltypeshp.shx,r=180,x=.1,s=.1],-.1
Note that the shape name is BAT, the shape file is "ltypeshp.shx". Also notice that there are two shape calls in the definition, the only difference is the rotation. The Batting linetype is a series of looping shapes linked together. The distance for the dash and space segments is kept very small so that the shapes appear to be interlinked. Here is the Batting linetype.
Although there are things you just cannot do with AutoCAD linetypes, they are pretty versatile. Use your imagination and you can come up with some unique linetypes when needed. Use Wingdings or some other specialty font for odd characters in your linetypes. If you need quote (or "inch") marks in a text based linetype, use the trick found here. Check out the image below, yes even this is an AutoCAD linetype.