AutoCAD 2004 Customization Tutorial: Shapes with Straight
Lines, Part 2
June 12, 2003
In a previous tutorial I explained how you can create shape
files for defining simple straight line shapes. Here you learn
more on defining straight line shapes. If you are not familiar
with shapes read the following tutorials first, please read the
and also one on Using Shapes.
Download the following drawing file. The file will help you in
calculating shape information [Figure 1].
Note: If you are using an earlier release of AutoCAD
Open the file in AutoCAD.
Disable all running OSnaps but Intersection.
Draw a 22 square [Figure 1]. Here you will define "P1" as the
insertion point. The line P1-P2 should not appear on screen.
command line enter Notepad and then press Enter twice to start
Notepad window enter the proper code [Figure 2].
The description codes are broken into 3 lines
for your convenience. You may write them in a single or
The 005 saves the current location of the pen.
The 006 will later restore the location.
The 002 causes the pen up. Thus the 01A line
will not appear in the shape. The 001 later puts the pen down
to start drawing.
The 01A means draw a unit line in the A
direction. The 020 means draw a 2 unit line in the 0
Save the file as "slcomp.shp".
Compile and then load the compiled file "slcomp.shx" in a new
Insert the shape.
Close the new drawing without saving.
AutoCAD draw the squares shown in Figure 3.
Notepad enter the proper code to define the new shape [Figure
The 007 uses another shape to define the
current shape. The sub-shape number should follow this code.
For example here sub-shape 201 (i.e. the square) will be
The 003 divides the size of all subsequent
shapes by a number that follows the code. In this example the
size of subsequent shapes will be divided by 2.
The 004 multiplies the size of all subsequent
shapes by the number that follows the code. Here the 3 is
used. Since the division factor is still in effect the final
multiplication factor will be 3/2 or rather 1.5.
Compile the shape file.
Load the compiled shape file in a new drawing.
Insert the new shape in the drawing and then close the drawing
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
firstname.lastname@example.org or visit his website