• Skip to main content
  • Skip to primary sidebar
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

Unlock Your Design Potential: Creating Custom Hatch Patterns in AutoCAD (and Using Them in Revit!)

June 22, 2025

Tired of the same old hatch patterns in AutoCAD? Need something specific to represent a unique material or a particular design aesthetic? Creating your own custom hatch patterns is easier than you think! This guide will walk you through the process of crafting bespoke .pat files in AutoCAD and even show you how to bring those custom creations into Revit.

Why Bother with Custom Hatches?

While AutoCAD comes with a decent library of hatch patterns, there are times when you need something more:

  • Material Specificity: Accurately represent unique building materials like custom stonework, specific siding types, or, as we’ll demonstrate, precast concrete elements.
  • Design Standards: Adhere to company or project-specific graphic standards.
  • Enhanced Visual Communication: Create clearer, more informative drawings that precisely convey your design intent.
  • Creative Expression: Add a unique visual flair to your drawings.

Understanding the Anatomy of an AutoCAD .PAT File

AutoCAD hatch patterns are defined in simple text files with a .pat extension. You can create these using any basic text editor, like Notepad. Each pattern definition consists of two main parts:

  1. Header Line:
    • Starts with an asterisk (*).
    • Followed immediately by the pattern name (no spaces, max 31 characters).
    • Optionally, a comma and a description can follow the name.
    • Example: *MYPATTERN, My first custom pattern
  2. Data Line(s):
    • Each data line defines a family of parallel lines that make up the hatch.
    • The format for each data line is: angle, x-origin, y-origin, delta-x, delta-y, [dash-1, dash-2, ...]
    Let’s break down these parameters:
    • angle: The angle of the lines in degrees (e.g., 0 for horizontal, 45 for diagonal, 90 for vertical).
    • x-origin, y-origin: The X and Y coordinates of a point through which one line of this family will pass. This acts as the starting point for the line family relative to the hatch origin.
    • delta-x (Shift): The displacement of the dash pattern along the direction of the line. This is primarily used for creating staggered dashed lines. For continuous lines or non-staggered patterns, it’s often 0.
    • delta-y (Offset): The perpendicular distance between the lines in this specific family. This defines how often the line repeats.
    • [dash-1, dash-2, ...] (Optional): A series of numbers defining the lengths of dashes and gaps. Positive numbers are dashes, negative numbers are gaps, and a 0 represents a dot. If omitted, the line is continuous.

Important File Rules:

  • If a .pat file contains a single hatch pattern, the file name should ideally match the pattern name (e.g., PRECAST.pat for a pattern named *PRECAST).
  • AutoCAD also uses acad.pat (imperial) and acadiso.pat (metric) files, which can store multiple pattern definitions. You can add your custom patterns to these, but be careful when upgrading or sharing.
  • Crucially, there must be a blank line after the last data line in your .pat file for AutoCAD to recognize it properly.

Where AutoCAD Looks for .PAT Files:

AutoCAD searches for .pat files in the folders specified in its Support File Search Path (Options > Files > Support File Search Path). You can save your custom .pat files in one of these locations or add your custom folder to this path.

Example: Creating a “Precast” Hatch Pattern

Let’s create a custom hatch pattern to represent “Precast” concrete. The design calls for a repeating group of three closely spaced parallel lines at a 45-degree angle, followed by a gap that is the same width as the group of three lines.

1. Define the Parameters:

  • Angle: 45 degrees
  • Small Spacing (s): The perpendicular distance between the individual lines within the three-line group. Let’s use s = 0.1 drawing units.
  • Group Width: The three lines will span 2s (from the center of the first line to the center of the third line) = 2 * 0.1 = 0.2 units.
  • Gap Size: The gap after the three lines will be equal to the group width, so 2s = 0.2 units.
  • Total Repeat Distance (D_repeat): The total perpendicular distance before the entire three-line group repeats is Group Width + Gap Size = 2s + 2s = 4s = 4 * 0.1 = 0.4 units.

2. Derive Line Definitions:

We need to define three families of lines, all at 45 degrees. Each family will have the same delta-y of 0.4 units, ensuring the entire group repeats correctly. The difference will be their x-origin and y-origin to create the close spacing.

  • Line 1: This line will pass through the pattern’s origin (0,0).
    • angle = 45
    • x-origin = 0
    • y-origin = 0
    • delta-x = 0 (continuous line)
    • delta-y = 0.4
  • Line 2: This line needs to be parallel to Line 1 but shifted perpendicularly by s = 0.1 units. To achieve this, the line must pass through a point that is 0.1 units away from the origin, in a direction perpendicular to 45 degrees (e.g., along the 135-degree axis).
    • x_offset = s * cos(135°) = 0.1 * (-1/√2) ≈ -0.070710678
    • y_offset = s * sin(135°) = 0.1 * (1/√2) ≈ 0.070710678
    • angle = 45
    • x-origin ≈ -0.070710678
    • y-origin ≈ 0.070710678
    • delta-x = 0
    • delta-y = 0.4
  • Line 3: This line is shifted by 2s = 0.2 units perpendicularly from Line 1.
    • x_offset = 2s * cos(135°) = 0.2 * (-1/√2) ≈ -0.141421356
    • y_offset = 2s * sin(135°) = 0.2 * (1/√2) ≈ 0.141421356
    • angle = 45
    • x-origin ≈ -0.141421356
    • y-origin ≈ 0.141421356
    • delta-x = 0
    • delta-y = 0.4

3. The “PRECAST.PAT” File Code:

Create a new text file named PRECAST.PAT (or a name of your choice, ensuring the pattern name inside matches) and paste the following code:

Code snippet

*PRECAST, Three lines at 45deg, 0.1 spacing, 0.2 gap
45, 0,0, 0,0.4
45, -0.070710678,0.070710678, 0,0.4
45, -0.141421356,0.141421356, 0,0.4

(Remember to press Enter after the last line to ensure there’s a blank line at the end of the file!)

The precision of the coordinates (e.g., using more decimal places for 1/√2) helps ensure the lines are accurately spaced, especially at different scales.

Tips for Creating Custom Hatch Patterns:

  • Start Simple: Begin with basic patterns (e.g., a single dashed line or a simple crosshatch) to understand the syntax.
  • Iterate and Test: Create your .pat file, save it, then try loading it in AutoCAD using the HATCH command. Select “Custom” or “User Defined” from the pattern type dropdown. If it doesn’t look right, edit the .pat file, save, and test again.
  • Mind Your Units: The units in your .pat file are relative to the drawing units in AutoCAD. A spacing of 0.5 will mean 0.5 inches if your drawing is in inches, or 0.5 mm if it’s in millimeters.
  • Sketch it Out: For more complex patterns, sketching your design on graph paper can help you calculate angles, origins, and offsets.
  • Use a Plain Text Editor: Avoid word processors like Microsoft Word, as they can add hidden formatting that will corrupt the .pat file. Notepad (Windows) or TextEdit (Mac, in plain text mode) are good choices.

Importing Your Custom AutoCAD Hatches into Revit

Good news! You can leverage your custom AutoCAD .pat files directly in Revit. Here’s how:

  1. Understanding Pattern Types in Revit:
    • Drafting Patterns: These scale with the view’s scale. They represent materials symbolically (e.g., a sand pattern always looks the same size on paper, regardless of the model scale).
    • Model Patterns: These represent real-world dimensions. They scale with the model elements. For our “Precast” example, which represents a physical object with defined spacing, a Model Pattern is usually more appropriate.
  2. Steps to Import:
    • Open Revit.
    • Go to the Manage tab.
    • In the Settings panel, click the Additional Settings drop-down and select Fill Patterns.
    • In the Fill Patterns dialog box, under Pattern Type, select either Drafting or Model based on your needs (likely “Model” for our Precast example).
    • Click the New fill pattern button (looks like a page with a small sunburst).
    • In the New Pattern dialog:
      • Select Custom.
      • Click the Browse… button.
      • Navigate to your saved .pat file (e.g., PRECAST.PAT) and select it. Click Open.
    • Revit will display the pattern(s) found in the file.
      • You can change the Name of the pattern as it will appear in Revit.
      • Crucially, you might need to adjust the Import scale. If your .pat file was defined with units that differ from your Revit project’s interpretation, the pattern might appear too large or too small. Experiment with this value until the preview looks correct. For example, if your PAT file used inches for its units and Revit is working in feet, you might need an import scale. Often, starting with 1.0 is fine if the PAT units are sensible.
    • Click OK to close the New Pattern dialog, and OK again to close the Fill Patterns dialog.

Your custom hatch pattern is now available in Revit to be used in Filled Regions, Material definitions (for surface or cut patterns), and more!

Conclusion

Creating custom hatch patterns in AutoCAD opens up a new level of control and precision in your drawings. While the .pat file syntax might seem a bit cryptic at first, a little practice will have you designing your own unique patterns in no time. And with the ability to seamlessly import these into Revit, you can ensure consistent and accurate graphical representation across your entire design workflow. So, go ahead, experiment, and elevate your drawings beyond the defaults!

Filed Under: AutoCAD Tutorials, Revit Tutorials

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (24)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (28)
  • AutoCAD Tutorials (43)
  • AutoLISP Routines (146)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (67)
  • Electrical Drafting (2)
  • General IT reference (12)
  • Geometry (15)
  • GIS (2)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (12)
  • Structural Drafting (24)
  • Technical Dictionary (45)
  • Useful Website Links (19)

Provided for free with no warranty · Log in