|Page (1) of 1 - 01/18/05||email article||print page|
A complex line type is the same as a simple line type. Except it has shapes or text added to it. The shapes are defined in SHP files. This is a little bit complicated. The shapes are defined in SHP files. But we use the shapes of SHX files. These are compiled SHP files.
Later I'll come back to this one. I'll explain how shapes are defined and specified. I'll also explain how to create your own shapes. Now let's go to the complex line types. Let's explain how you can create your own complex line types. How to
add shapes or text. The definition of complex line types can be found in the LIN files. There they are stored together with the
simple line types. Before we continue. I must make something very clear. I complex line types can contain shapes or text. It cannot contain shapes and text.
Now we're ready to create our complex line type. We start with creating a line type that has one shape in it. Later we'll add more shapes. I could tell you a long story. But let's do it the short way. Let's do it the QAD way. QAD stands for
quick and dirty.
We open the ACAD.LIN file in a text editor. And from that file we copy a definition of a complex line type. We'll have a look at that definition. This is such a definition. It's the definition of the FENCELINE line type. Here it is:
*FENCELINE1,Fenceline circle ----0-----0----0-----
The same as with simple line types. The definition consists of two lines. On the first line is the name and description of the line type. On the second line you can find the pattern of the line type. In the pattern the shape of the line type is specified.
The name of the line type starts with an asterisk. Nothing new. Then there is a comma and the description. Some dashes and zeros have been added to it. The second line starts with the alignment character. AutoCAD has only one alignment character. That's the character A. In the second line you find positive and negative numbers. These numbers stand for spaces and lines. You could also have zeros for dots.
And then there's the specification of the shape. The specification is between square brackets. You see a shape name and a shape file name. After the shape name and the shape file name is the transform. The transform is optional. It can have the
following five entries:
R=## - relative rotation
A=## - absolute rotation
S=## - scale
X=## - X offset
Y=## - Y offset
The meaning of each entry is clear. At least that's what I think. You can imagine what the relative rotation, the absolute rotation is. For the transform a character is entered plus the is equal sign. After the is equal sign are numbers. The numbers can be positive or negative.
For the FENCELINE line type the transform has only two entries. These entries are X and S. The X offset is set and the scale. Where to find the SHX files and the name of the shapes? Go to the SUPPORT folder of AutoCAD and look for them.
There are two SHP files.
The first file is the GDT.SHP file. The other file is the LTYPESHP.SHP file. For your complex line types you can only use that one. Open the LTYPESHP.SHP file in a text editor. Here is an entry you can find in that file:
The name of the shape is TRACK1. You can use that name together with the name of SHX file in the definition of your complex line type. Did you notice? In the specification of the shape in the definition of the complex line type is are commas.
That's how each entry is separated. You can add more shapes to one definition of a complex line type. Here's an example of how that's done:
*TEST,Test line type
But take care. Put a line, a space, or a dot between the two specification of the shape. If you omit it then only the first shape is drawn. You can now create your own complex line type with a shape. Go ahead. Give it a try. See how it works. Use the try and error method. That's what you'll see. A line specified by a number is drawn to the heart of the shape. See how you must enter spaces and so.
Once you start with AutoLISP, you will be saving lots of time and money with AutoCAD. Don't know AutoLISP?
Here are the books for learning.