How to

How to Add New Hatch Pattern in AutoCAD

How to Add New Hatch Pattern in AutoCAD
Rachid Khouri
Written by Rachid Khouri

Adding custom hatch patterns in AutoCAD is an essential skill for CAD users, especially those working in architecture, engineering, or design. Hatch patterns allow you to visually represent different materials and textures like concrete, wood, or landscaping elements. In this guide, we’ll walk you through the steps to install and manage custom hatch patterns in AutoCAD, troubleshoot common issues, and explore advanced techniques for working with hatch patterns.


Why Add Custom Hatch Patterns?

AutoCAD comes with a default library of hatch patterns, but sometimes you need more flexibility. Custom hatch patterns allow you to:

  • Represent unique materials or textures specific to your project.
  • Create visual consistency across your drawings.
  • Improve the readability of technical drawings by using tailored patterns.

Adding a custom hatch pattern can greatly enhance your workflow, whether you’re designing a building, a landscape, or a mechanical part.


How to Add New Hatch Pattern in AutoCAD

Step 1: Locate and Save the PAT File

To install a custom hatch pattern, you need a .PAT file, which defines the pattern. Follow these steps depending on your operating system:

For Windows:

  1. Locate the default support folder:
    • Place the .PAT file in the AutoCAD Support folder. The typical path is:
      C:\Users\<username>\AppData\Roaming\Autodesk\AutoCAD<version>\Rxx.x\<language>\Support
      

      Note: Ensure that hidden folders are visible since AppData is a hidden folder. You can enable hidden folders through Windows Explorer settings.

  2. Add a custom folder (if you want to organize your custom hatch patterns):
    • Type OPTIONS in AutoCAD’s command line.
    • Go to the Files tab, expand Support File Search Path, and click Add.
    • Browse to your custom folder where the .PAT files are stored and add it to the search path.

For MacOS:

  1. Access the Hatch Library:
    • Type HATCH in the command line.
    • In the Hatch visor, click the pull-down for Patterns and select Open Library.
    • Click Add Patterns, then browse and select your .PAT file.
    • AutoCAD will automatically copy the pattern to:
      ~/Library/Application Support/Autodesk/AutoCAD<version>/Rxx.x/roaming/@<language>@/Support/Hatch Patterns
      

Step 2: Load the Custom Hatch Pattern in AutoCAD

Once you’ve saved the .PAT file, follow these steps to load the custom hatch pattern in AutoCAD:

  1. Set the System Variable:
    Type HPDLGMODE in the command line and press Enter. Set the value to 1 to enable the hatch dialog box.
  2. Open Hatch Command:
    • Type HATCH and press Enter. The Hatch and Gradient dialog will appear.
  3. Select Custom Hatch:
    • In the Type drop-down menu, select Custom.
    • Click the three dots (...) next to the Custom Pattern field to open the Hatch Pattern Palette.
    • Find your custom .PAT file in the left frame and select your pattern from the right frame.
    • Click OK to load the pattern and apply it to your drawing.

Step 3: Creating a Custom PAT File

If you need to create a custom hatch pattern, AutoCAD allows you to do so by writing a .PAT file. Here’s how:

  1. Open a Text Editor:
    Use a basic text editor like Notepad.
  2. Write the Pattern Code:
    The structure of a .PAT file is as follows:

    *PatternName, Description
    angle, x-origin, y-origin, delta-x, delta-y, dash1, dash2, ...
    

    Example of a simple pattern:

    *MyPattern, Simple horizontal lines
    0, 0, 0, 10, 10
    
    • PatternName: The name you will see in AutoCAD.
    • Angle: The angle of the lines.
    • Delta-x, Delta-y: Spacing between the lines.
  3. Save the File: Save the file with a .PAT extension.

Troubleshooting Common Issues

Sometimes, custom hatch patterns may not load or display correctly. Here are some common errors and their solutions:

  • PAT file not found:
    Ensure the .PAT file is saved in a folder included in the Support File Search Path (check this in OPTIONS > Files > Support File Search Path).
  • Corrupted or incorrect PAT file format:
    Open the .PAT file in a text editor and check for:

    • Matching file name and pattern name.
    • One pattern per .PAT file.
    • A blank line at the end of the file.
  • Pattern does not display:
    Make sure the enclosed area where you’re trying to apply the hatch is properly closed. If the area is open, AutoCAD cannot apply the pattern.

Advanced: Importing Hatch Patterns from External Sources

In addition to creating your own patterns, you can also import custom hatch patterns from external sources. Follow these steps to import .PAT files downloaded from third-party websites or generated in other software:

  1. Download the .PAT file from a trusted source (ensure the file is not corrupted).
  2. Add the file to the Support Path:
    • Follow the steps outlined above in Step 1 to add the folder containing the downloaded .PAT files.
  3. Load the Pattern:
    • Go to HATCH, select Custom, and browse for the pattern in the Hatch Pattern Palette.

Frequently Asked Questions (FAQs)

Q1: How can I edit an existing hatch pattern?

You can edit existing hatch patterns by modifying the .PAT file. Open the file in a text editor and adjust the parameters (like line spacing, angle, etc.).

Q2: Why is my custom hatch pattern not displaying?

Ensure the .PAT file is in the correct folder, the file isn’t corrupted, and the enclosed area is fully closed. If necessary, check the file’s syntax.

Q3: Can I transfer custom hatch patterns to other AutoCAD versions?

Yes, you can copy the .PAT file to the Support File Search Path on another system or version of AutoCAD.


Conclusion

By following this guide, you can easily add and manage custom hatch patterns in AutoCAD, allowing for greater customization and accuracy in your drawings. Whether you’re working in architecture, engineering, or design, custom hatch patterns are a powerful way to elevate your AutoCAD work.

See also  How to Add Plot Styles in AutoCAD: A Complete Guide

About the author

Rachid Khouri

Rachid Khouri

Rachid Khouri is a CAD engineer, CAD Manager, Developer, Authorized Autodesk Author, and Corporate Trainer with over 30 years of experience in the CAD industry. He started his career in 1992 with AutoCAD version 10 and has since worked as a draftsman, CAD manager, and developer for various companies. In 1999, he opened a school in Quebec, Canada, providing professional training on Autodesk software, and in 2006, launched online AutoCAD courses. He founded CADdikt.com and then KAutoCAD.com, two portals dedicated to sharing resources, tutorials, and downloads for CAD enthusiasts, with a special focus on AutoCAD.