While AutoCAD comes with a large variety of hatch patterns, you can also create your own. This feature has been around for many years.
Hatch patterns are stored in files with a file extension of .pat. You can add your hatch to the default acad.pat or create your own .pat file. As always, don’t forget to make a copy of acad.pat or acadlt.pat before you edit it.
If you create your own .pat file, here are some points to remember:
- If you aren’t adding patterns to acad.pat or acadlt.pat, you can put only 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
Note: To find the location of acad.pat or acadlt.pat, right-click the drawing area and choose Options; then 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:
Did you find this tip helpful?
Don't miss new tips!
Plus get a free Dynamic Blocks tutorial
Enter your name and email below
angle, x-origin,y-origin, delta-x,delta-y [, dash1, dash2, …]
Hatch-pattern definitions have a few rules:
- The description is optional; if you include one, precede it with a comma.
- 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.
Check out this free dynamic block tutorial
Plus get free tips in our AutoCAD Tips Newsletter!
Get a free tutorial on creating a complete dynamic block, including a drawing to practice on. You'll make a movable chair, resizable desk, and more. PLUS, the highly-acclaimed AutoCAD Tips Newsletter will keep your skills up to date!
This following explains the meaning of the terms in the definition:
- Angle: Defines the angle of the lines in the hatch pattern. If you also specify an angle in the Boundary Hatch and Gradient dialog box when you place the hatch, AutoCAD adds the two angles.
- X-origin: Specifies the X coordinate of the base point of the hatch pattern. Your hatch probably won’t go through 0,0; however, this point lines up sets of lines in hatch patterns, as well as aligning 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 applies only to dashed lines and is measured along the direction of the lines. Specifying a delta-x staggers each successive line by the amount that 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.
Let’s look at a couple of examples.
*ftrailer, proposed future trailers
105, 0,0, 0,0.5, .5,–.25,0,–.1,0,–.25
This hatch has an angle of 105 degrees, an origin of 0,0, a delta-x of 0, a delta-y of 0.5 (the spacing between lines), and then defines a non-continuous linetype (dash, space, dot,space,dot,space)
Here’s a more complex example:
*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
This hatch pattern has 4 lines. Two are at 0 degrees, and two are at 90 degrees. This creates the rectangular shape. The difference between the two lines that start at 0 degrees is their origin. The second one starts at 0,1.5. The 90-degree lines also have different origins. The linetype for the 90-degree lines is dash, space, dot, space, dash, space.
See how the effect of trailers is created?
Have you created a great hatch pattern? Share it by leaving a comment!