Custom Linetypes (.LIN) AutoCAD provides the ability to create custom linetypes or to adjust the linetypes supplied with the system during installation. Linetypes in AutoCAD can be classified into two areas, simple and complex. Simple linetypes are those that contain only lines, spaces, and dots. Complex linetypes contain special text or symbols. The principle method of creating a linetype in AutoCAD is by identifying the linetype characteristics you wish to create and placing them in a special text file so AutoCAD can make use of it. A linetype definition file must end in the.lin file extension. A linetype definition consists of 2 lines of information. The first line in a linetype definition is the header line. The header line must begin with an asterisk (*) followed by the name you wish to call the linetype. The new linetype name needs to be only a single word, without any special characters or spaces, but may include underscores ( _ ). Following a comma, you may then add a brief description of the linetype, traditionally the new linetype is shown through the use of dashes or underscores, spaces, and periods. The second line in a linetype definition is the pattern line and must begin with a capitol A. The remaining pattern definition consists of plus and minus values indicating whether there is a line or a space. Plus values indicate a line of that length will be drawn, minus values indicate a space the length of the value, and a zero indicates a dot. All of these values are separated by commas. You only program up until the linetype repeats itself. In the case or our example, there is a.5 inch line followed by a.125 space. There is then a dot represented by the zero, followed by another.125 space. At this point the.5 line begins again and the entire linetype repeats itself over and over again. There is no need to repeat what has already been defined; only program up to the repeat. In virtually all cases, your pattern definition line will end in a minus value.
Now let s save the file and try it out. At the Command prompt type LINETYPE or just LT to bring up the Linetype Manager dialog box. Select LOAD to add linetypes to the list in the dialog box. This brings up the Load or Reload Linetypes dialog box. Select Files and locate your file. After you select OPEN you will see the linetypes that are available in your file. Select linetype1 from the list and OK to finish loading it into your file. You can now access linetype1 just as you would any other linetype that has been previously loaded into your drawing. Select OK and draw some lines, circles, and plines in your drawing. Select the geometry you just created and the linetype pulldown from the Properties toolbar to change the linetypes of the geometry. Depending on the size of the lines, your window setting, you may need to also change the LTSCALE or ZOOM in to see the linetype correctly.
Complex linetypes are essentially the same as a simple linetype, with the exception that the user may add special text or symbols to be displayed in the line. An example would be for a gas or water line in a housing development. The linetype could display as the following: --------- GAS --------- GAS --------- or --------- WATER --------- WATER --------- If you look in the default ACAD.LIN file that comes with AutoCAD, you will notice several complex linetypes for Hot Water Supply, Tracks, and ZigZag to name a few. Begin the complex linetype the same as your simple linetype, with a header line and a pattern line. I will display the GAS_LINE linetype from the ACAD.LIN file as an example. I have copied its definition into the file that was copied into the C:\DRF271 or Z:\DRF271 folder earlier in the course. A,.5,-.2,["GAS",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.25 Notice the big block of information in brackets: ["GAS",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05] This is where the complex linetype gets its text. The brackets are not really needed, as the computer doesn t read them, but as humans, we need help separating things out and this is the way AutoCAD allows us to keep things in order. Now to decipher the bracketed information: Begin the definition with the Text String you wish to use in the linetype. This must be in double quotes and is followed by a comma. The next item is the Text Style. One word of caution, if you use a text style that is not loaded into a drawing, you will get an error message and the linetype will not work. I suggest that you only use the STANDARD text style. This name must also be in ALL CAPs. The next item is the Text Size. A text size in the area of 1/8 is good and should display well when adjusted with the LTSCALE command. The example shown is setup with a 1/10 text size because it is simple to work with. The Text Rotation Angle allows you to rotate the text to some angle other than along the line. I don t know if I have ever seen a text rotation angle of anything other than 0 or 90, but the option is there and available to use. The last two items are the X and Y offset values. This allows the user to offset the text up or down, left or right of the point on the line that the test is initially being displayed. I find that setting the X Offset Value to 0 and the Y Offset Value to a negative value of one half of the Text Size works well for me. In the example, the X Offset Value is set to -.1 to center the text about the initial text insertion point. Remember to place a comma between all individual items in the linetype pattern definition.
Let s look again at the completed linetype definition file: A,.5,-.2,["GAS",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.25 Now that we understand what is in the brackets, we need to understand how AutoCAD uses the information in the placement of the text along the line when it draws the line in your drawing. This linetype will begin with a.5 line, followed by a.2 space. It is at this point that the text will begin, this is the initial text insertion point talked about earlier. AutoCAD looks at the X Offset Value and places the text accordingly. In our example it backs up the line and places the text -.1 back along the line. It also moves the text down and places it so the line is in the middle of the text. The Y Offset Value determines this distance. AutoCAD now writes out the text, GAS in our example. We have not moved the insertion point any and we are still looking at a point.2 from the end of our.5 line. If we were to continue a line from this point, it would cross over the last part of our text. We need an additional negative value to add additional blank space sufficient enough for the line to begin again after the word has been completely written. This is where the -.25 comes from at the end of the line in our example. After the final negative value, we must press the ENTER key so AutoCAD knows that the pattern line is complete. Try it out. Load the linetype and assign it to some geometry in AutoCAD. There is something to note about this linetype definition. If you were to use a longer Text String than GAS, GAS LINE for example, the text string does not bend with the line, but is a straight piece of text. This is not generally a problem, but if you are using longer text strings in your linetype definitions, you may want to Change your definition a little bit to allow the linetype to curve with the line. This procedure is not difficult, but you do need to create one of those bracketed command strings for every letter or set of letters in the text you want to use. When done correctly, it gives the linetype that extra finished polished look. The example to the right groups 2 letters at a time and the linetype definition is shown below. To give the linetype the really clean definition, you would not group letters together, but have a bracketed command sequence for every letter in the text string. This makes for a very long linetype definition, but one that is well worth it in the end.
Complex linetype definition grouping sets of letters together: *GAS, Gas line ----GAS----GAS----GAS----GAS----GAS----GAS-- A,.5,-.2,["GAS",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.65 A,.5,-.2,["GA",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.2, ["S ",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.2, ["LI",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.175, ["NE",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.5 Notice the differences in the two linetype definitions. Remember that you can only have 2 lines in the linetype definition, but the screen does not permit more than a certain number of characters to be displayed on a line. You may split up the pattern definition line if you do the following. Make sure there is a comma at the end of the first pattern definition line sequence. Do NOT put another capital A at the beginning of the next line, but continue placing complex bracketed sequences as shown in the above example. After each bracketed sequence you will need another negative value to space out the initial point the next Text String will be located. You will notice that not all of the negative values at the end of the sequence lines are the same. This was done to make the text strings look better in the final linetype when it is displayed on the screen. Also note that it is extremely important NOT to place a comma after the final negative value in the linetype pattern definition line sequence. Press the ENTER key to end the final sequence and save file before you try to load it. (Many students forget to save their linetype definition files after they work on them and when they try to load or reload the linetype definition, they get the old or original linetype without the edits they just made. Always save your work at regular intervals.) Your assignment is to create a new simple linetype and two complex linetypes. The simple linetype needs to consist of a ¾ line followed by a 1/8 space followed by a ¼ line followed by another 1/8 space, followed by a dot, followed by a 1/8 space, another ¼ line, and ending with a final 1/8 space.... Call this linetype2 and place it in your file. The first complex linetype file will consist of 7/8 lines with your first given name imbedded into it. This definition will need only one complex bracketed sequence with a single text string. The second complex linetype file will consist of a 1 line with your initials imbedded into it. This time, you will need to create a complex bracketed sequence for each letter in you initials. When you have completed the linetypes, tried them out, and they work, submit the completed file to the instructor.