Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Autocad 2005 And Autocad LT 2005 Bible (2004).pdf
Скачиваний:
92
Добавлен:
17.08.2013
Размер:
32.22 Mб
Скачать

926 Part VI Customizing AutoCAD

5.Choose File Save and save it in your AutoCAD Bible folder as ab31-02.lin..

6.Choose Layer Properties Manager from the Layers toolbar. Choose Buried_cable and click its Continuous linetype in the Linetype column. In the Select Linetype dialog box, choose Load. Click File. Find ab31-02.lin in your AutoCAD Bible folder, choose it, and click Open.

7.In the Load or Reload Linetypes dialog box, choose TV and click OK. Do the same in the Select Linetypes dialog box. Click Current. Click OK.

8.Click Linetype Control from the Layers toolbar and choose Other. In the Linetype Manager, click Show Details to display the Details section. Change the Global Scale Factor to 192. Click OK.

9.Draw some lines or polylines. Zoom in to see the linetype more clearly. Figure 31-5 shows the resulting linetype.

10.Save your drawing.

Figure 31-5: The TV linetype.

Creating Hatch Patterns

Hatch patterns are sets of parallel line patterns that are used to fill an enclosed area. Although the part of the hatch pattern definition that defines each line has some similarities to a linetype definition, for hatch patterns you also need to specify the angle and spacing of the lines. You cannot include text or shapes in hatch patterns.

Hatch patterns are stored in files with a file extension of .pat. The acad.pat and aclt.pat files include a large number of hatch patterns. You can add to or edit this file or create your own .pat file. As always, don’t forget to make a copy of acad.pat or aclt.pat before you edit it. When creating your own .pat file, remember the following:

If you aren’t adding patterns to acad.pat or aclt.pat, you can only put one hatch pattern in a custom .pat file. The filename and pattern name must be the same.

You can insert comments in your .pat file after a semicolon.

You must press Enter after the end of the last line of the hatch definition.

Chapter 31 Creating Your Own Linetypes and Hatch Patterns 927

Note

To find the location of acad.pat or aclt.pat, choose Tools Options and click the Files

 

tab. Double-click the Support File Search Path item, to display the location of the support files.

The syntax for hatch patterns is as follows:

*pattern-name[, description]

angle, x-origin,y-origin, delta-x,delta-y [, dash1, dash2, ...]

Here are some general points for hatch-pattern definitions:

The pattern name cannot have spaces.

The description is optional.

Add the dash specifications only for noncontinuous lines.

You can have more than one definition line (the second line in the syntax I just showed), creating sets of hatch definitions that combine to create the hatch pattern.

Each definition line can be no more than 80 characters.

You can include a maximum of six dash specifications (which include spaces and dots).

You can add spaces in the definition lines for readability.

Table 31-2 describes the features of a hatch-pattern definition.

 

Table 31-2: Hatch-Pattern Definitions

 

 

Specification

Explanation

 

 

Angle

Defines the angle of the lines in the hatch pattern. If you also specify an angle in the

 

Boundary Hatch dialog box, the two angles are added. For example, if a hatch pattern

 

defines lines at 105 degrees and you specify a hatch angle of 30 degrees, you end up

 

with lines running at 135 degrees.

X-origin

Specifies the X coordinate of the base point of the hatch pattern. Although your hatch

 

probably won’t go through 0,0. This point lines up sets of lines in hatch patterns as well

 

as to align hatch patterns in different areas. Because all hatch patterns are calculated

 

from the base point, they’re always aligned, no matter where they actually appear in

 

the drawing.

Y-origin

Specifies the Y coordinate of the base point of the hatch pattern.

Delta-x

Specifies the offset of successive lines. This only applies to dashed lines and is

 

measured along the direction of the lines. Specifying a delta-x staggers each successive

 

line by the amount you specify so that the dashes don’t line up.

Delta-y

Specifies the distance between lines, measured perpendicular to the direction of the

 

lines. This applies to both continuous and dashed lines.

Dash

Defines a noncontinuous line using the same system as linetype definitions: positive for

 

a dash, negative for a space, and 0 for a dot.

 

 

928 Part VI Customizing AutoCAD

The hatch pattern shown in Figure 31-6 is the simplest form of hatch pattern.

Figure 31-6: The ftrailer hatch pattern with continuous lines.

Although you could specify this simple hatch pattern in the Boundary Hatch dialog box by specifying a user-defined hatch with an angle and spacing, the example that follows shows the syntax clearly. The lines are at an angle of 105 degrees; the hatch pattern starts at 0,0; and the spacing between the lines is 0.5 units. The lines are continuous.

*ftrailer, proposed future trailers 105, 0,0, 0,0.5

Adding one level of complexity, you can make the lines in the hatch pattern noncontinuous, as follows:

*ftrailer, proposed future trailers 105, 0,0, 0,0.5, .5,–.25,0,–.1,0,–.25

Note that this definition uses the maximum of six dash specifications (the dash, space, dot, space, dot, and space).

A close-up of this hatch pattern is shown in Figure 31-7.

Figure 31-7: The ftrailer hatch pattern with a dash and two dots.

If you add a delta-x of 0.25, the lines in the pattern are staggered by 0.25 units, along the direction of the lines, as shown in this code and in Figure 31-8:

*ftrailer, proposed future trailers

105, 0,0, 0.25,0.5, .5,–.25,0,–.1,0,–.25

You might wonder why the pattern staggers downward after adding a positive delta-x. The answer is that the direction of the lines (in this case, 105 degrees) becomes the X axis for this

Chapter 31 Creating Your Own Linetypes and Hatch Patterns 929

calculation. Figure 31-9 shows a zoomed-in display of the hatch pattern around 0,0, which is the base point. The hatch pattern is being generated up and to the left. The first line starts at 0,0, and the second line starts to the left by 0.5 units (the delta-y) and up by 0.25 units (the delta-x), as shown by the dimensions.

Figure 31-8: The ftrailer hatch pattern with an added delta-x.

Figure 31-9: Calculating how the delta-x and delta-y affect a hatch pattern.

Finally, you can add additional definition lines. One of the definition lines should start at 0,0, but the others may start anywhere. Here is the definition for the pattern in Figure 31-10. It actually creates the shape of the trailers. Although you see the rectangular shape, the hatch pattern is created from four separate lines — two at 0 degrees and two at 90 degrees. Note that the two 0-degree lines are the same except that they start at different base points. The same is true for the two 90-degree lines.

*trail,

whole trailers-proposed

0,

0,0,

0,2,

.5,–1

90,

0,0,

 

0,1.5, .5,–.25,0,–.25,.5,–.5

90,

.5,0,

0,1.5, .5,–.25,0,–.25,.5,–.5

0,

0,1.5,

0,2,

.5,–1

930 Part VI Customizing AutoCAD

Figure 31-10: The trail hatch pattern looks like trailers.

STEP-BY-STEP: Creating and Using a Hatch Pattern

1.Open a drawing using any template.

2.Save the file as ab31-03.dwg in your AutoCAD Bible folder.

3.Type notepad and press Enter at the File to edit: prompt.

4.Type the following:

*lightning, interwoven lightning 90, 0,0, 0,.5, .5,–.25 0, –.25,.5, 0,.75, .25,–.25

90, –.25,.5, 0,.5, .5,–.25

5.Press Enter after the last line. Save the file as lightning.pat in your AutoCAD Bible folder. Close Notepad.

6.If you haven’t already done so, you need to add your AutoCAD Bible folder to the support-file search path. Choose Tools Options and click the Files tab. Click the plus sign to the left of Support File Search Path. Choose Add. Choose Browse. Find your AutoCAD Bible folder and click OK. Click OK again to close the Options dialog box.

7.Choose Rectangle from the Draw toolbar. At the first prompt, type 0,0 . At the

Specify other corner point or [Dimensions]: prompt, type 10,6 .

8.Choose Hatch from the Draw toolbar. In the Type drop-down list, choose Custom.

9.Click the ellipsis to the right of the Custom Pattern text box. Choose the lightning.pat file you just created. Click OK.

10.Choose Select Objects and pick the rectangle in your drawing. Press Enter. Click OK. The rectangle fills with the lightning hatch, as shown in Figure 31-11.

11.Save your drawing.