CCAD inc. Home Page - Experienced Drafting & Design Services, AutoCAD Training & AutoCAD Enhancements. AutoCAD Tips, Tricks and Shortcuts by CCAD inc.

AutoCAD Tips to Work Smarter - February 2004

Design AutoCAD Training Calendar AutoCAD Tips Acad Faqs
AutoLISP® Downloads About CCAD Contact CCAD Search

Creating a Linetype With Text

In the Creating a Simple Linetype tip I outlined the process for make a linetype with dashes, dots and spaces. This tip sheet examines the techniques necesary to create a linetype that includes text characters.

Let's begin simply with a linetype comprised of a 0.5 dash and a 0.55 space. In the space, the characters TEXT3 are to appear. The image below is the completed linetype.

Examining Structure of a Linetype with Text

In addition to defining the dashes, dots and spaces in the linetype,you must define the text that will appear. The characters to be displayed, the text style used, the scale or height of the text, the rotation angle of the text and the X and Y offset from the end of the previous space must all be specified.

The character or text specification is enclosed in square brackets "[]" and each item is separated by commas ",". The format of the character specification is shown below.

["text",textstylename,scale,rotation,xoffset,yoffset]

Creating a Linetype Using a Text Editor

Linetypes containing characters and shapes must be created using a text editor. The Visual LISP Editor included with AutoCAD or MicroSoft's Notepad can be used.

Let's begin by defining a linetype with a and a 0.55 space and the characters TEXT1. Begin a new file using the Visual LISP Editor, Notepad or other text editor. Type the following text in your new file

*Text1,---- Text1 ---- Text1 ---- Text1 ---- Text1 ---- Text1 ----
A,.5,-.1,["Text1",STANDARD,S=.1,R=0.0],-.45


I've broken the space for the text into two parts. If the a single space is used, the text may overlap the dash toward the end of the pattern as AutoCAD tries to complete the pattern. Use the image below to identify the various elements of the lientype.

.
Save the file using the name CCAD.LIN. Linetype files must have the extension LIN. Make a note of the folder where you've saved the file.

Next, the CCAD.LIN file must be loaded. Begin AutoCAD or switch to the AutoCAD window if already open. Type LINETYPE and press ENTER or select Linetype from the Format menu. Click the Load button near the upper right corner.



Click the File button near the top left of the Load or Reload Linetypes window. This will allow you to load Linetypes from files other than ACAD.LIN.



Using the Select Linetype window, locate the CCAD.LIN file and click the Open button.

Click on the Text1 linetype and then the OK button. Exit the remaining windows and test the new linetype.


Now let's add the X offset to position the text within the space. Copy the Text1 linetype and make the changes shown below to create the Text2 linetype.

*Text2,---- Text2 ---- Text2 ---- Text2 ---- Text2 ---- Text2 ----
A,.5,-.1,["Text2",STANDARD,S=.1,R=0.0,X=-0.075],-.45



You'll need to repeat the process above to load the Text2 linetype from the CCAD.LIN file.


Finally, copy the Text2 linetype and make the change below, including the Y offset.

*Text3,---- Text3 ---- Text3 ---- Text3 ---- Text3 ---- Text3 ----
A,.5,-.1,["Text3",STANDARD,S=.1,R=0.0,X=-0.075,Y=-0.05],-.45


The Text1, Text2, and Text3 linetype definitions can be downloaded from the CCAD.LIN file. I've include a few fun linetypes in this file as well. Feel free to download and use these linetypes.
Next month's Tip Sheet will demonstrate how to create a linetype with shapes.