hatchpatterns_autocad

6

Click here to load reader

Upload: cernomodiac-nicolae

Post on 23-Apr-2017

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HatchPatterns_AutoCad

Custom Hatch Patterns (.PAT) AutoCAD provides the ability to create your own custom hatch or fill patterns. We will begin with a few items that must be remembered:

1. The name of the hatch pattern file must be the same as the custom hatch pattern. 2. The custom hatch pattern file must end in the ‘.PAT’ extension. 3. Only one custom hatch pattern can be in the hatch pattern file.

You will start your custom hatch pattern in the same way that a custom linetype is created. I assume by now that you are familiar with the OPTIONS dialog box and your C:\DRF271 or Z:\DRF27 folder is located on top of the file list. If it isn’t or you have changed computers, you will need to add it to this list or you will never be able to find your custom hatch file. One other caution, do not use the same name for several different hatch patterns and place them in different folders. Only one hatch pattern with that name will be available and 9 out of 10 times it will be the one you don’t want to use, or one that has an error in it. It is very frustrating to keep working on a file that you know is right but doesn’t work because the computer is reading the wrong file. Open AutoCAD and type ‘NOTEPAD’ at the ‘Command’ prompt. When it asks you for a file name, enter C:\DRF271\BOX1.PAT or Z:\DRF271\BOX1.PAT for the new hatch pattern file. This will automatically place the file in your DRF271 folder. The first line of the custom hatch pattern is identical to the first line in a custom linetype definition. It consists of an asterisk (*) followed by a comma and a description of the hatch pattern. In this case, you would not attempt to recreate the hatch pattern graphically, but would describe the hatch pattern using plain text. BOX1.PAT *BOX1, Simple 1/2” box hatch pattern

|

Note that the name of the file and the name of the custom hatch pattern must be the same. Believe me, it will not work if the two names are different. The second, third, forth, etc., lines in the hatch pattern definition must now identify the angle of the line, where the line begins, and other information in order to create the 2 dimensional hatch pattern. When we were creating linetypes, we were only working with a single line. With a hatch pattern, we have the ability to add more lines to the definition, and to place them at different angles with respect to the other lines in the hatch definition. In this example, we will add the follow as the second line. BOX1.PAT *BOX1, Simple 1/2” box hatch pattern

0, 0,0, 0,.5, .5,-.5 |

The hatch pattern definition lines must follow a specific format. The spacing between the various items of information is not important. It is used to better allow the user to see what is being done and to organize the file data in an easy to read format. Enter the second line and save the hatch pattern definition file. We will now see if everything is working the way it is supposed to by loading and placing the hatch pattern.

Page 2: HatchPatterns_AutoCad

To load a custom hatch pattern, you will first need an object boundary to fill. For the purposes of this course, I strongly suggest that you create a circle of radius 3 and place it at 0,0 or the origin of your drawing. This will place the drawing origin at the center of your hatch pattern. When placing a hatch pattern, there is hatch pattern origin that all elements of the hatch pattern are defined from. If you have a problem with your hatch pattern, it is easier to troubleshoot if you have the hatch pattern origin on the screen. To load your custom hatch pattern, select the ‘HATCH’ tool bar icon or type ‘HATCH’ at the ‘Command’ prompt. The ‘Boundary Hatch and Fill’ dialog box appears.

Click in the ‘Swatch:’ area and the ‘Hatch Pattern Pallet’ dialog box show up. This is the dialog box that allows you to select from the various predefined hatch patterns, or to select your own custom pattern. Select the ‘Custom’ tab at the top of the dialog box. You should see your custom hatch in the list. By selecting your pattern, you should see a thumbnail of it in the little box on the right. In the event there is an error, you will see an error dialog box instead. If this is

the case, there are two frequent problems that students make, your error is most likely one of these: 1. Make sure your filename and hatch pattern name are identical. 2. Make sure you have pressed the ‘ENTER’ key at the end of the last

pattern definition line so AutoCAD knows that your are finished with the hatch pattern definition.

If there are no errors, you should select ‘OK’ and will see the ‘Boundary Hatch and Fill’ dialog box again with your hatch pattern in the ‘Swatch:’ box. Click on the ‘Pick Points’ button and then click inside your circle, press the ‘ENTER’ key to return to the dialog box. Select the ‘Preview’ button to see your hatch pattern in the circle, and press the ‘ENTER’ key to keep the hatch pattern and end the command.

Page 3: HatchPatterns_AutoCad

Notice that the origin is at the beginning point of one of the hatch pattern lines. Now we will look at exactly what happened in the pattern definition line. The Angle of Line is zero, so the line will be horizontal. The Line Origin is at 0,0 so we see the beginning point of one of the lines at the origin of the drawing. The X,Y Offset is zero along the X axis and .5 along the Y axis. This places the next line in the pattern directly above the previous line with a ½” separation. Because hatch patterns are repeated to fill the entire boundary, the repeat of the pattern is very important. In this case, the repeat is only ½”. The Line Definition consists of a .5” line followed by a .5” space. This is repeated in the other hatch pattern lines above and below the original line. You can delete the hatch pattern in the circle so we don’t have a conflict later, and we will create the next line to finish out our box. BOX1.PAT *BOX1, Simple 1/2” box hatch pattern

0, 0,0, 0,.5, .5,-.5 90, 0,0, 0,.5, .5,-.5 |

The second pattern definition line is identical to the first, with the exception that it is going to be vertical or 90 degrees. When we save the file and insert the hatch pattern we get the following: Let’s look closely at what has happened and why the second line works to create a box with only the angle being changed. In the second line, the Angle of Line is now 90 degrees. This draws the line vertically from the Line Origin of 0,0 The X,Y Offset is the item that needs to be fully understood. The X,Y Offset is based on the

Angle of Line, which means that the direction of the X axis has been changed to 90 degrees for this part of the hatch pattern definition. The offset of zero in the X direction (which is now vertical) remains the same, as we want a box to be created with a line beginning at the drawing origin, and the offset of .5 in the Y direction also remains the same so the lines mate up with the corners of the 1/2” lines already drawn.

The actual drawing origin has not been altered. The only thing affected is the second line of the hatch pattern definition.

Page 4: HatchPatterns_AutoCad

Now let’s put another line in the hatch pattern definition. This time we will place the line at 45 degrees to begin creating a large X in the middle of each box. Before we create this line, we need to find out what numbers are needed to create the angled line at the right locations and at the correct length to mate up with the corners of the boxes. The best way to do this is draw out the hatch pattern the way you want it to look when completed and measure the lines and spaces. You will notice the red line in the example. This is the line we intend to draw. You will also notice that I have adjusted the number of decimal places in my dimensions to 8 places. The greater the number of decimal places will allow you to avoid a rounding error the further you get away from the drawing origin. We will explain this in more detail later. Notice also the UCS icon has been rotated 45 degrees. This is to represent the 45 degree line that we will be drawing and to assist us in better understanding the X,Y Offset portion of the hatch pattern definition. With this drawing, we are able to identify the size of the lines and spaces we need to create the 45 degree line in our hatch pattern. BOX1.PAT *BOX1, Simple 1/2” box hatch pattern

0, 0,0, 0,.5, .5,-.5 90, 0,0, 0,.5, .5,-.5 45, 0,0, .70710678,.70710678, .70710678,-.70710678 |

In our third line of the hatch pattern definition, we will begin with the Angle of Line of 45 degrees. Our Line Origin will continue to be 0,0 Our X,Y Offset is again affected by the Angle of Line and is rotated 45 degrees. This now requires that we use the distance between the opposite corners of the box as our X offset value. Because our boxes are symmetrical and evenly spaced in this example, the Y offset value the same as our X offset value. Our Line Definition consists of a line from one corner of the box to the other, followed by a space from the corner of one box to another. Our example, being symmetrical and evenly spaced, uses the .7071078 value for both the length of the line and the space. The resulting hatch pattern shows a diagonal line across each box. The final line in our hatch pattern definition will complete the X in the box. From what we have already done, we can easily come up with all of the numbers we need to complete the pattern. BOX1.PAT *BOX1, Simple 1/2” box hatch pattern

0, 0,0, 0,.5, .5,-.5 90, 0,0, 0,.5, .5,-.5 45, 0,0, .70710678,.70710678, .70710678,-.70710678 135, .5,0, .70710678,.70710678, .70710678,-.70710678 |

Page 5: HatchPatterns_AutoCad

We begin by identifying the Angle of Line to be drawn. In this case we will use 135 degrees. The Line Origin will be different in this final definition line because we want the line to be inside the box and not outside of it. If we were to use the 0,0 origin, the line would begin at the origin with all of the other lines and head off in the 135 degree direction. This is not what we want, so we need to begin the line 1/2” along the X axis and 0 along the Y axis. This part of the definition is based on the current UCS of the drawing and is unaffected by the 135 degree direction we want to draw our line. As a result, we need to identify the Line Origin to be .5,0 The remainder of our hatch pattern definition will be the same as in the third line, because the distances have not changed. The resulting pattern shows the X in the middle of the boxes. This has been a simple pattern where the pattern repeat has been even and only four lines have been required to create this pattern. When a more complex pattern is created, the pattern repeat is even more critical. The first step in identifying the pattern repeat, is to draw out the complete pattern in regular AutoCAD. This is when you work out all of your problems and identify the number and angles of all of the lines in your pattern. You may need to adjust one of your angles, or even the closeness of the objects you plan to draw. I have found that if I keep to angles in increments of 15 degrees (1, 15, 30, 45, 60, 75, 90, etc.), things tend to work themselves out better and finding a repeatable pattern is much simpler. However, you are not restricted to these angles, but remember to increase the precision value in your angle dimensions to give you degrees, minutes, and seconds, so the angle is as accurate as possible. I have also found that using a screen grid and snap can greatly assist me in the creation of my initial hatch pattern drawing. This tool can help line up the repeats and help with the overall neatness of the pattern, though you tend to get away from the even 15 degree increment lines when you use the grid and snap method. You should have copied the ACAD.PAT file into your C:\DRF271 folder earlier in the course. Open up this file using NOTEPAD and look at the definitions of the standard hatch patterns that come with AutoCAD. Hopefully you will be able to understand what it is they are doing with each line of a hatch pattern definition. You will notice that some of the patterns have been spaced out to better see what is going on, and other have not. You will also see that some of the patterns contain very complex definition lines such as the ESCHER and GRAVEL patterns. The AR-PARQ1 pattern on the other hand, contains a lot of pattern definition lines, but they are simple whole numbers and easily understood.

We have created a custom hatch pattern and must place it in it’s own separate file. You may add your custom hatch pattern to the bottom of the ACAD.PAT file after you have proven it works the way you want it to. I prefer to keep the ACAD.PAT file just as it came with AutoCAD, and continue to place my individual custom hatch patterns in their own files just as you have been shown here.

Page 6: HatchPatterns_AutoCad

Continue to look at the ACAD.PAT file, and find the STARS and HEX patterns. I have identified the individual hatch pattern in red for each of the following examples. I have also identified how each line is repeated in blue.

When you create you own custom hatch pattern, you will need to identify how each line repeats to complete the hatch pattern definition. Your assignment is to create 2 custom hatch patterns. The first needs to contain a pattern with the following dimensions. You will find that the beginning is very similar to your BOX1.PAT file. You will need a total of eight pattern definition lines.

Your second hatch pattern definition will be of your own design. Create the pattern in AutoCAD and identify how the pattern will repeat itself. Email this drawing to the instructor and get approval before you spend too much time on the pattern. In most cases students don’t have a problem, however, there have been cases where students have a tendency to over do it and create a pattern that can’t be done, or create a pattern that is so simple that it doesn’t meet the course requirements. When you are finished with both custom hatch patterns, submit both of the custom PAT files to the instructor.