5.3 Boundary Hatches & Gradients
Key Takeaways
Boundaries are defined by Pick Internal Points (ray-casting flood fill) or Select Boundary Objects (explicit entity selection), with HPGAPTOL bridging minor drafting gaps.
Island detection styles dictate internal fill patterns: Normal alternates concentric nested boundaries, Outer fills only from the perimeter to the first island, and Ignore fills across all internal islands.
The HPLAYER system variable automatically routes newly created hatches to a dedicated layer, bypassing the active current layer to preserve CAD standards.
Setting the Hatch Pattern Origin (HPORIGIN / Set Origin) aligns pattern geometry to specific datum points, essential for architectural tile, paving, and masonry layouts.
Associative hatches (HPASSOC = 1) dynamically adapt their geometry and area when surrounding boundaries are edited, while non-associative hatches remain static and can have boundaries recreated via HATCHEDIT.
5.3 Boundary Hatches & Gradients
Note
Hatches and gradients communicate material cross-sections, structural compositions, finish surface layouts, and zoning boundaries in design drawings. In AutoCAD, hatching is driven by an associative database engine that analyzes boundary geometry, detects interior islands, evaluates scale, and dynamically updates when geometry shifts. Mastering hatch architecture, island detection, and pattern origins is vital for production efficiency and the Autodesk Certified Professional (ACP) exam.
1. HATCH Command Architecture & Boundary Detection
Executing HATCH (or H) activates the contextual Hatch Creation ribbon tab in the modern AutoCAD interface. If the ribbon is closed, or HPDLGMODE = 1, AutoCAD displays the classic Hatch and Gradient dialog box. Running -HATCH opens the command-line interface for script automation.
Boundary Identification Methods:
Pick Internal Points: Select Boundary Objects:
┌──────────────────────┐ ┌──────────────────────┐
│ x [Pick Pt] │ │[Select Outer Circle] │
│ │ │ │
│ ┌─────────┐ │ │ [Select Box] │
│ │ Island │ │ │ │
│ └─────────┘ │ │ │
└──────────────────────┘ └──────────────────────┘
(Casts rays across visible screen; (Analyzes only selected objects;
computes boundary dynamically) fast, precise, immune to off-screen geometry)
Pick Internal Points vs. Select Boundary Objects
AutoCAD provides two fundamental boundary determination techniques:
- Pick Internal Points: Casts imaginary rays across all visible vector geometry within the current display viewport to identify closed loops surrounding the picked point. This is ideal for irregular spaces formed by the intersections of multiple overlapping lines, arcs, and polylines. However, in dense drawings containing tens of thousands of entities, ray-casting incurs substantial calculation overhead.
- Select Boundary Objects: The user directly selects closed objects (such as closed polylines, circles, ellipses, or regions). AutoCAD restricts boundary evaluation strictly to the selected entities, ignoring the surrounding drawing canvas. This method is exponentially faster in complex drawings and avoids accidental island inclusion.
Boundary Sets: Current Viewport vs. a Selected Boundary Set
When you pick an internal point, AutoCAD does not search the whole drawing. It analyzes a boundary set, the group of objects it may use as edges (objective 3.2.d: Current Viewport vs. Boundary Set):
- Use Current Viewport (default): The boundary set is everything within the extents of the current viewport. Dense geometry slows detection, and objects you never meant to use (furniture, dimensions, text) can become unexpected edges or islands.
- Select New Boundary Set: On the expanded Boundaries panel of the Hatch Creation tab (or in the boundary set area of the Hatch and Gradient dialog box), choose Select New Boundary Set and select only the walls, slab edges, or property lines that should define the area. Picked points are then evaluated against that set alone, which is faster and ignores clutter.
- Use Boundary Set: Once a set exists, later picks keep using it until you switch back to Use Current Viewport.
Tip
With Use Current Viewport, objects outside the current viewport's extents are not in the boundary set, so a room that runs off screen may fail to close. Zoom so the whole area is visible, or define a boundary set.
Boundary Gap Tolerance (HPGAPTOL)
A frequent obstacle during hatching is the "Valid closed boundary not found" error, caused by microscopic gaps between line endpoints. The HPGAPTOL system variable establishes a Gap Tolerance (in drawing units):
- When
HPGAPTOL = 0(default), boundaries must be mathematically closed. - When
HPGAPTOL > 0, AutoCAD ignores gaps equal to or smaller than the tolerance value, treating the boundary as closed and allowing the hatch to generate without error.
Boundary Retention and the BOUNDARY Command
By default, AutoCAD creates the hatch object and discards the temporary boundary loop it computed. However, you can retain the boundary geometry:
- In the Hatch ribbon tab under Boundaries, check Retain Boundaries.
- The system variable
HPBOUNDcontrols the object type created:0creates Region objects;1creates closed Polyline (LWPOLYLINE) objects. - Alternatively, the standalone
BOUNDARY(orBO) command generates a closed polyline or region from an enclosed area without creating a hatch.
2. Island Detection Styles
An Island is any closed interior boundary located completely inside the outermost boundary perimeter. AutoCAD evaluates islands using three distinct styles configured via the Hatch ribbon Options panel or the HPISLANDDETECTION system variable (whether islands are detected at all is set by HPISLANDDETECTIONMODE):
Island Detection Styles Visual Comparison:
Normal Style Outer Style Ignore Style
┌──────────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐
│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
│▒▒▒┌──────────────┐▒▒▒│ │▒▒▒┌──────────────┐▒▒▒│ │▒▒▒│▒▒▒▒▒▒▒▒▒▒▒▒▒▒│▒▒▒│
│▒▒▒│ │▒▒▒│ │▒▒▒│ (Unhatched) │▒▒▒│ │▒▒▒│▒▒▒▒▒▒▒▒▒▒▒▒▒▒│▒▒▒│
│▒▒▒│ ┌──────┐ │▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│▒▒▒│▒▒▒▒▒▒│▒▒▒│▒▒▒│
│▒▒▒│ │▒▒▒▒▒▒│ │▒▒▒│ │▒▒▒│ ┌──────┐ │▒▒▒│ │▒▒▒│▒▒▒│▒▒▒▒▒▒│▒▒▒│▒▒▒│
│▒▒▒│ └──────┘ │▒▒▒│ │▒▒▒│ │ │ │▒▒▒│ │▒▒▒│▒▒▒│▒▒▒▒▒▒│▒▒▒│▒▒▒│
│▒▒▒└──────────────┘▒▒▒│ │▒▒▒└──────────────┘▒▒▒│ │▒▒▒└──────────────┘▒▒▒│
└──────────────────────┘ └──────────────────────┘ └──────────────────────┘
(Alternates concentric islands) (Fills to first island only) (Hatches through all islands)
| Island Style | HPISLANDDETECTION | Operational Behavior & Industry Application |
|---|---|---|
| Normal | 0 | Alternates hatching inward from the outer boundary. The outermost area is hatched, the first interior island is skipped, the next nested island is hatched, and so on. Used for concentric architectural walls and mechanical cross-sections. |
| Outer | 1 (initial value) | Hatches exclusively from the outermost perimeter inward to the boundary of the first island encountered. All interior islands and nested geometry remain completely blank and unhatched. Standard for building footprints with interior courtyards. |
| Ignore | 2 | Bypasses all internal island boundaries entirely, hatching through every interior entity to fill the outermost boundary solid. Used when applying zoning shading or site-wide hatching where interior lines must be overlaid. |
3. Pattern Types & Property Architecture
AutoCAD organizes hatch patterns into four distinct structural categories:
Pattern Categories:
├─ Predefined: Read from acad.pat (Imperial) or acadiso.pat (Metric); ANSI, ISO, AR- patterns
├─ User-Defined: Parallel lines generated on the fly; customizable spacing; optional Double grid
├─ Custom: External proprietary .pat pattern files loaded from designated search paths
└─ Gradient: Smooth photometric color transitions (Linear, Cylindrical, Spherical, Hemispherical)
- Predefined: Sourced directly from the AutoCAD pattern definition libraries (
acad.patfor Imperial drawings,acadiso.patfor Metric drawings). Common examples includeANSI31(standard diagonal cross-section),ANSI32(steel),ANSI33(bronze, brass, copper),SOLID(100% solid fill),AR-B816(8 x 16 concrete block elevation), andAR-CONC(aggregate concrete). - User-Defined: Generates simple linear patterns on the fly based on the current linetype. You specify an exact Spacing distance between lines. Checking the Double option (
HPDOUBLE = 1) draws a second set of identical parallel lines oriented at to the first, creating a square or rectangular grid. - Custom: Sourced from independent, user-authored
.pattext files located within AutoCAD's Support File Search Path. - Gradient: Generates smooth, photo-rendered transitions between two colors (or one color transitioning to white/black). Useful for schematic presentations, solar panel glazing, liquid levels in civil tanks, and architectural glass shading.
Critical Hatch Properties & System Variables
| Property | System Variable | Default | Function & Operational Limits |
|---|---|---|---|
| Hatch Pattern | HPNAME | "ANSI31" | Specifies the active default hatch pattern name. |
| Pattern Scale | HPSCALE | 1.0 | Multiplies the base pattern dimensions. If set too dense, HPMAXLINES halts processing to prevent memory crash. |
| Pattern Angle | HPANG | 0 | Sets rotation angle relative to current UCS. Note that ANSI31 already contains a built-in angle. |
| Transparency | HPTRANSPARENCY | "use current" (.) | Sets explicit transparency from 0 to 90%, allowing background geometry to show through solid fills. |
| Hatch Layer | HPLAYER | "." (Current) | Specifies an automatic target layer for all new hatches (e.g. A-PATT), avoiding manual layer switching. |
| Associativity | HPASSOC | 1 | Controls whether new hatches are associative (1) or non-associative (0). |
Warning
The HPMAXLINES Safety Limit: When HPSCALE is set excessively small relative to a vast boundary, AutoCAD may attempt to calculate millions of hatch lines, locking up system memory. AutoCAD protects itself via the HPMAXLINES system variable (default 1,000,000). If a hatch exceeds this limit, AutoCAD halts rendering and issues the alert: "Hatch spacing too dense, or dash size too small." To resolve this, increase the pattern scale factor.
4. Associativity, Pattern Origin & Annotative Behavior
Associative Hatches vs. Non-Associative Hatches
- Associative (
HPASSOC = 1): The hatch is dynamically bound to its defining boundary objects. When a wall is moved, stretched (STRETCH), or trimmed, the hatch automatically recalculates its area and reshapes itself to fit the new boundary in real time. - Non-Associative (
HPASSOC = 0): The hatch exists as an independent, static geometric object. If the boundary is moved, the hatch remains behind in its original location.
If boundary geometry is modified such that a closed boundary is broken, associativity is permanently severed. To restore associativity without redrawing:
- Select the hatch and type
HATCHEDIT(orHE). - Click the Recreate Boundary button.
- Choose whether to recreate the boundary as a Polyline or Region.
- When prompted
Reassociate hatch with new boundary? [Yes/No]:, answer Yes.
Setting the Hatch Pattern Origin (HPORIGIN)
By default, AutoCAD calculates hatch pattern alignments relative to the origin coordinates of the World Coordinate System (WCS). In large architectural plans, this causes patterns (such as floor tiles or masonry bricks) to intersect walls at awkward, arbitrary fractions:
Default Origin (0,0 WCS): Specified Origin (Set to Corner):
┌───┬───┬───┬───┬───┐ ┌───────┬───────┬───────┬───────┐
│ ░ │ │ │ │ ░ │ (Awkward slivers) │ Full │ Full │ Full │ Full │
├───┼───┼───┼───┼───┤ ├───Tile┼───Tile┼───Tile┼───Tile┤
│ │ │ │ │ │ │ │ │ │ │
└───┴───┴───┴───┴───┘ └───────┴───────┴───────┴───────┘
▲ Pattern starts cleanly here
To align tiles cleanly with a physical datum:
- Select the hatch entity.
- On the Hatch Creation or Hatch Editor ribbon tab, click Set Origin.
- Snap to the desired reference point (such as the lower-left corner of a room or a door threshold).
- AutoCAD repositions the pattern so that a full, uncut tile originates precisely at the selected coordinate.
Tip
Under the Origin panel dropdown, you can also select predefined alignment origins: Bottom Left, Bottom Right, Top Left, Top Right, or Center, which automatically computes the boundary bounding box.
Annotative Hatches
When a hatch is designated as Annotative, its pattern spacing automatically scales according to the active viewport annotation scale (CANNOSCALE). This ensures that an ANSI31 hatch pattern plots with the exact same visual line spacing on a 1/4"=1'-0" architectural detail as it does on a 1"=10'-0" site plan.
5. Hatch Maintenance: HATCHEDIT, Separate Hatches, and MATCHPROP
- HATCHEDIT (
HE): Opens the Hatch Editor interface to modify existing hatches without exploding or deleting them. Allows toggling associativity, swapping patterns, modifying scale, and setting origins. - Separate Hatches (
HPSEPARATE): When you hatch multiple disjoint areas during a single command session, AutoCAD groups them into one unified hatch entity by default. If you later need to delete or re-color one room, all rooms are affected. Checking Create Separate Hatches (or settingHPSEPARATE = 1) forces AutoCAD to generate distinct, independent hatch entities for every closed loop. - MATCHPROP (Match Properties): Typing
MATCHPROP(orMA) allows you to select a source hatch and apply its pattern, scale, rotation angle, layer, color, and transparency to any number of destination hatches with a single click.
An architectural drafter is applying a concrete floor pattern to a large room containing several interior equipment pads and conference room enclosures. The drafter needs the hatch pattern to fill the open floor space up to the perimeter of the interior enclosures, while leaving all interior spaces and nested furniture inside those enclosures completely unhatched. Which island detection style must be selected?
Normal
Ignore
Outer
Raycast
When hatching a restroom floor with an architectural ceramic tile pattern (a user-defined double grid sized to the tile), the tile pattern appears misaligned, displaying irregular partial tile slivers along the primary entrance wall. How should the drafter correct the pattern layout so full tiles start cleanly at the doorway corner?
Increase the HPSCALE system variable by a factor of 2.0
Change the island detection style from Normal to Ignore
Explode the hatch and move the individual tile lines with the MOVE command until they line up
Select the hatch and use Set Origin to pick the doorway corner as the pattern origin
A technician attempting to hatch an intricate site plan boundary using Pick Internal Points receives an error message stating that a valid closed boundary could not be determined. Inspection reveals that several property boundary lines fail to connect by gaps of approximately 0.04 drawing units. How can the technician hatch the area without manually tracing, extending, or filleting each open corner?
Set the HPGAPTOL system variable to 0.05 or higher before executing the HATCH command
Change the HPBOUND system variable to 0 so that the boundary is generated as region objects
Set HPMAXLINES to 10,000,000 so that AutoCAD performs more boundary scan iterations
Switch the hatch pattern type from Predefined to User-defined
Pick Internal Points keeps treating furniture blocks and dimension lines in a large open-office plan as islands, and every pick takes a long time. Which hatch setting limits boundary detection to the wall linework?
Choose Select New Boundary Set on the Boundaries panel and select only the wall objects
Increase HPGAPTOL until it is larger than the spacing between the furniture blocks
Switch the island detection style from Normal to Ignore before picking the points
Set HPBOUND to 0 so the retained boundary is created as a region object
Sections you finish are checked off in the contents.