From Cheap Tricks,
June '91 & Oct '94 Issue

Published By:
Shu Associates, Inc.
120 Trenton St., Melrose, MA 02176-3714
(617)662-0020 (FAX Same)
eshu@world.std.com


Custom Linetypes

With our article in April '91 about hatching techniques, some of you have gotten intrigued with the potential possibilities of writing your own custom linetypes. We will offer an example here to show you how easy it is to write a linetype.

Recently, while working on an existing house renovation, we decided that we really needed a "Dentil" linetype, as we had a house which had a lot of these wonderful to look at, but pain in the neck to draw dentil mouldings all over the place. A perfect task for custom linetypes.

[Illustration of entry elevation with dentil molding.]

Your linetypes all reside in the file DCAD.LIN, normally found in the SUP directory under your main DATACAD directory. They may be accessed as simple ASCII files using the EDIT command of MS-DOS (or Notepad) even using your word processor as long as you remember to save the file in an ASCII or text only format.

Simply put, they are a listing of graphic instructions. If you think of each custom linetype as a series of identical beads on a chain, then this file contains the design for the first bead on every different kind of chain design.

In DataCAD, each bead in our line chain can be thought of as being housed in a square box of 100 units by 100 units. [Illustration of these instructions in graphic form.] To design a custom linetype, we need to write instructions of direction and length within this 100 by 100 box. Our instructions can arbitrarily begin anywhere within the box, but they must return to their starting point at the end of the sequence. Use the same angle direction that you use in DataCAD; namely due East is 0 degrees, North is 90, West is 180, and South is 270.

For our dentil moulding, we simply want to have a series of repeating squares and spaces. So you can see from the illustration, the written description of the four strokes we need are first, 50 units at 270 degrees, then, 50 at 0 degrees, next, 50 at 90, and finally 50 at 180.

Now our new custom linetype is written thus:

>Dentil
1.0
270 50
0 50
90 50
180 50

The name of your linetype is preceded by the greater than sign ">", then the next number is a scaling factor, 1.0 meaning one foot equals 100 units. Use 1.0 unless you know that your dentil is always 2" wide, then you might write .33333 for your scaling factor (translates to 100 units equal 1/3 of a foot equals 4", therefore 50 units equals 2"). However, note that your linetype spacing function in DataCAD will always give you the flexibility you need to size your linetype properly.

But what if your linetype cannot be described as a continuous line you ask? Then you use a negative number to describe a plotter pen movement in the up position. (A negative angle is simply an angle read clockwise from due East.)

So say we wanted a linetype called Dentil Shadow or "DentShad" (8 letter limit), which would only draw two of our previous four lines. This linetype would be written as follows:

>DentShad
1.0
270 -50
0 50
90 50
180 -50

Now for some caveats. Don't go wild with new linetypes. You have only 20 new slots available after the mandatory four of Solid, Dotted, Dashed and Dot-Dash. Also, you should note that DataCAD uses linetypes not by name but by order, so that if you are continually switching your linetypes, your old drawings may come up very weird as the program will use the 15th linetype in you current DCAD.LIN file, not what used to be the 15th linetype at the time you made the file. This factor also makes it difficult to swap drawings between different users if they have radically different linetype files. So you should modify your DCAD.LIN file very carefully and thoughtfully with the long range view in mind.

Certainly keep copies of all your previous versions of DCAD.LIN, under a different name, particularly the issued file that came with a major release (e.g. DCAD70.LIN.) You may need it at later time. Even with these drawbacks in mind, judicious use of customized linetypes is a very powerful tool indeed.

Reprint from Cheap Tricks, June '91 & Oct '94
All rights reserved


To go back to the Reprints Page

How to Subscribe

Shu Associates Inc.
120 Trenton St.
Melrose, MA 02176-3714
(617)662-0020 Tel & Fax

You can E-mail us by clicking here: eshu@world.std.com

Copyright © 1997, Shu Associates Inc.
Revised -- 5/12/97

URL: http://world.std.com/~eshu/cheap/linetype.htm