Create Custom Hatch Patterns with a PAT File Generator

Architects, BIM managers, and CAD technicians frequently encounter limitations when working with default drafting patterns. Standard libraries often lack the specific configurations required for unique material finishes, custom masonry bonds, or precise detail components. Manually coding these definitions in a text editor is time-consuming and prone to syntax errors that can cause software instability.

A PAT file generator provides a visual, streamlined solution to this challenge. By replacing manual text editing with a parametric interface, professionals can configure angles, origins, spacing, and dash sequences with instantaneous visual feedback. This approach eliminates the trial-and-error cycle of drafting pattern development, allowing teams to maintain strict company standards and accelerate documentation workflows in both AutoCAD and Revit.

Understanding the Structure of Hatch Pattern Files

To leverage a PAT file generator effectively, it is essential to understand how CAD engines interpret pattern definitions. Standard .pat files are structured as plain text instructions that define individual vectors. Each pattern block begins with a header row, followed by one or more line definition rows that dictate the geometry.

*PatternName, Description
angle, x-origin, y-origin, delta-x, delta-y, dash-1, dash-2, ...

The Anatomy of a Vector Line Definition

Every line sequence within a pattern relies on a specific sequence of coordinates and offsets:

  • Angle: Specifies the direction of the line segment in degrees, measured counterclockwise from the horizontal axis.
  • X-Origin & Y-Origin: Establishes the precise starting point coordinates for the line family, ensuring proper alignment across boundary segments.
  • Delta-X (Offset-X): Controls the displacement or shift of dashed line segments along the direction of the line angle.
  • Delta-Y (Offset-Y): Sets the strict perpendicular distance between parallel lines in the family. A value of zero is invalid as it would cause infinite overlapping rendering, risking application crashes.
  • Dash/Gap Array: Defines the repeating segment structure. Positive numbers represent visible line segments, negative values indicate empty spaces or gaps, and zero specifies a true dot.

AutoCAD vs. Revit Hatch Patterns: Key Structural Differences

While both platforms utilize the .pat extension, their rendering engines handle spatial relationships differently. A robust PAT file generator automatically appends the necessary metadata headers based on the chosen deployment platform.

AutoCAD Pattern Requirements

AutoCAD reads simple, scale-dependent geometric instructions. The scale of the hatch is controlled directly within the viewport properties or global hatch variables (HPSCALE). The file structure focuses entirely on pure vector coordinates.

Revit Pattern Enhancements

Revit distinguishes between two primary fill pattern types, requiring specific metadata declarations at the top of the file:

  • Drafting Patterns: These maintain a fixed size relative to the printed sheet, behaving similarly to AutoCAD patterns. They change scale proportionally when the view scale is adjusted.
  • Model Patterns: These represent actual physical dimensions on a building element, such as a 600x600mm acoustic ceiling tile or a specific brick course. They retain their true dimensions regardless of view scale, allowing users to align, rotate, and dimension directly to the pattern lines in elevation or 3D views.
;%VERSION=3.0
;%UNITS=INCH
*Custom_Tile, 24x24 Inch Model Tile
;%TYPE=MODEL
0, 0, 0, 0, 24
90, 0, 0, 0, 24

Step-by-Step Workflow for Custom Design Creation

Implementing a digital PAT file generator transforms a complex scripting task into a predictable, structured layout sequence.

1. Set the Target Environment and Units

Begin by selecting either AutoCAD or Revit compatibility. Specify the project unit system—Imperial (inches) or Metric (millimeters)—to ensure the calculated vectors line up perfectly with design documentation requirements.

2. Choose an Initial Configuration Template

Rather than calculating complex coordinates from scratch, start with an architectural preset closest to your design intent (such as linear, running bond masonry, herringbone, or basic grid lines).

3. Establish Vector Orientations and Spacing

Input the exact dimensional requirements for your layout. Adjust the angle for diagonal patterns and configure the perpendicular offsets (Delta-Y) to match the exact size of the specification sheets.

4. Code Dash and Gap Sequences for Complex Textures

For advanced graphics like insulation, dashed boundary fills, or textured concrete, input alternating arrays of visible dashes and invisible gaps. For example, a sequence of [0.5, -0.25, 0, -0.25] yields a 0.5-unit dash, a quarter-unit gap, a true dot, and another quarter-unit gap before repeating.

5. Validate via Real-Time Visual Canvas

Utilize the interactive preview window to pan and zoom across the pattern grid. This step allows you to inspect intersections, check offset tracking, and catch broken repeating logic before exporting.

6. Export and Deploy the .pat File

Once satisfied with the visual array, download the validated file or copy the raw text block directly into an existing library assembly.

Deploying Custom Patterns into Production Environments

Once a pattern is successfully exported from the PAT file generator, it must be placed into the appropriate directory for software integration.

Importing into AutoCAD

  1. Save the .pat file to a dedicated support folder.
  2. Open AutoCAD and enter OPTIONS into the command line.
  3. Navigate to the Files tab and expand Support File Search Path.
  4. Click Add, then Browse to link your custom pattern folder.
  5. Execute the HATCH command; the custom definition will appear under the Custom pattern tab.

Importing into Revit

  1. Open your target model file or project template.
  2. Navigate to the Manage tab, click Additional Settings, and select Fill Patterns.
  3. Choose either Drafting or Model depending on your intended use case.
  4. Click the New icon, select the Custom radio button, and hit Browse.
  5. Select the exported .pat file, set your import scale factor, and click OK to commit the pattern to the project definitions.

Technical Troubleshooting and Best Practices

  • Preventing App Crashes: Always verify that your perpendicular offset (Delta-Y) is a non-zero value. Parallel vector lines with zero offset force the graphics pipeline to render overlapping lines infinitely, causing performance degradation or fatal exceptions.
  • File Naming Rules: AutoCAD requires that the internal pattern name declared after the asterisk (*) exactly matches the external filename on your hard drive. For instance, *Custom_Brick_90 must be saved in a file named Custom_Brick_90.pat.
  • Scale Mismatch Errors: If a Revit model pattern displays at an incorrect size, check the header file metadata. Ensure the unit marker (;%UNITS=INCH or ;%UNITS=MM) matches the unit configuration you used during creation in the generator.

References

  • Autodesk Knowledge Network: About Custom Hatch Pattern Definitions and Syntax.
  • Revit Standard Fill Pattern Documentation: Model vs. Drafting Metadata Requirements.