home - about - advertise     
 
 
Sponsors
Navigation
Partners

 
AutoCAD Tutorial

AutoCAD 2004 Customization Tutorial: Shape Linetypes

June 19, 2003

 

Shape linetypes are combination of simple linetypes and shapes. If you are not familiar with simple linetypes and/or shapes, please read the relevant tutorials first:
 

AutoCAD 2004 Customization Tutorial: Simple Linetypes

AutoCAD 2004 Customization Tutorial: Using Shapes

AutoCAD 2004 Customization Tutorial: Shapes with Straight Lines, Part 1

AutoCAD 2004 Customization Tutorial: Shapes with Straight Lines, Part 2

AutoCAD 2004 Customization Tutorial: Adding Arcs to Shapes

Note: Linetypes are defined within text files that hold the LIN extension. There are two default LIN files "acad.lin" and "acadiso.lin". You may add the linetype definition to one of these files or create your own LIN file. The latter is safer as you are not changing the contents of existing files.

1. Download the following files

R16_String_Linetypes.dwg

Shape_lt.shx

Note: If you are using an earlier release of AutoCAD download the following files:

R15_String_Linetypes.dwg

Shape_lt.shx

2. Move "Shape_lt.shx" to a folder in AutoCAD search path. The file defines a shape called FLOWER.

Note: If you are not familiar with AutoCAD search path, read the following tutorial:

AutoCAD 2004 Customization Tutorial: Search Paths

3. Open the drawing file in AutoCAD.

4. In command line type Notepad and then press Enter twice. The Notepad window appears.

5. In Notepad window type the proper text [Figure 1].


Figure 1 - Click on image to enlarge

Notes:

  • The first line is called the linetype header. The header starts with an asterisk (*). The asterisk is followed by the linetype name. You may add a comma followed by some descriptive text about the linetype.

  • "A" is the alignment character. It always appears in the beginning of the definition line.

  • Positive numbers stand for dashes. Thus .75 means a dash which is 0.75 units long.

  • Negative numbers stand for spaces. Thus -.5 means a blank space which is -0.5 units long.

  • You need to define one segment of the linetype only.

  • The shape is defined within brackets. The general syntax is:
    [shapename,shapefilename,scale,rotate,xoffset,yoffset]

  • FLOWER is name of the shape that is defined within the shape file. Figure 2 shows a sample insertion of this shape.


Figure 2
  • Here the compiled shape file name is "Shape_lt.shx".

  • In this example the scale factor is equal to 0.25. Thus the original size of the shape will be divided by 4 (or rather multiplied by 0.25).

  • You can define the rotation angle of the shape relative to the line/curve by using the R= format. Therefore R=0.0 means the shape is aligned with the current line/curve segment. If you use the A=0.0 the shape will be aligned with respect to the positive X direction of the current UCS.

  • X-offset and Y-offset values help us to place the shape properly.

6. Save the file as "shape_lt.lin".

7. In AutoCAD command line, type LT and then press Enter. The Linetype Manager dialog box appears [Figure 3].


Figure 3 - Click on image to enlarge

8. Click Load. The Load or Reload Linetypes dialog box appears [Figure 4].


Figure 4

9. Click File.

10. In Select Linetype File dialog box locate and then open "shape_lt.lin" [Figure 5].


Figure 5 - Click on image to enlarge

11. The FLOWER linetype will be added to the Load or Reload Linetype dialog box [Figure 6].


Figure 6

12. Select the linetype in the list and then click OK. The linetype will be loaded [Figure 7].


Figure 7 - Click on image to enlarge

13. Click OK.

14. Select the objects on drawing environment.

15. From the Linetype Control drop down list select FLOWER [Figure 8].


Figure 8

16. Press Esc to deselect objects. The objects linetype is altered to FLOWER [Figure 9].


Figure 9 - Click on image to enlarge

 

About the Author

Alireza Parsai is the founder of cadpanel.com. He is a mechanical engineer with more than 12 years experience with AutoCAD. Alireza is an Autodesk Authorized Author, the AutoCAD consultant for Al Khawarizmi Institute, a contributing editor for Augiworld magazine, a writer for CAD Digest, an instructor for AUGI Training Program, and an elected speaker for Autodesk University 2002. He has written 7 books in Farsi, 3 booklets in English, and more than 30 articles for different magazines and newsletters. You can reach him at alireza.parsai@cadpanel.com or visit his website www.cadpanel.com

More CAD Corner tutorials >>

 

Newsletter

Get all the week's articles
FREE!
(current issue)