Historical Context & Motivation
In the earliest days of computer-aided drafting, hatching was a purely manual affair — drafters would specify a fill region by painstakingly selecting every edge of a closed area, and the resulting pattern lived as a static block of lines with no memory of the boundary that created it. When Autodesk introduced associative hatching in the mid-1990s, it fundamentally changed the relationship between fill patterns and their enclosing geometry. The hatch object now stored a pointer back to its boundary objects, so stretching a wall would automatically stretch the hatch inside it. This innovation saved enormous time but also introduced a new class of problems: what happens when the boundary is erased, exploded, or replaced by a different set of lines? Understanding how to recreate and reassociate hatch boundaries is essential for anyone maintaining production drawings in a collaborative environment.
The central question this lesson addresses is straightforward yet surprisingly nuanced: when a hatch object loses its boundary — through editing, exploding, or importing from another file — how do you reconstruct a valid boundary and re-establish the associative link so that future geometry modifications propagate correctly through the hatch? This is a routine maintenance task in professional CAD workflows, and mastering it will save you significant debugging time on collaborative projects.
Core Principles & Definitions
Before diving into procedures, it is important to formalize the key abstractions that AutoCAD uses internally. A hatch object is a single entity stored in the drawing database that contains three categories of information: the pattern definition (name, scale, angle), the fill geometry (the actual line segments or solid fill), and a set of boundary path references. The boundary path may be stored as object references (handles pointing to existing lines, arcs, or polylines) or as coordinate data embedded directly within the hatch entity. This distinction is the key to understanding when recreation is possible and when association is possible.
Associative Hatch
Non-Associative Hatch
Boundary Recreation
Boundary Association
HATCHASSOCIATIVITY System Variable
1, new hatches are associative. When 0, they store embedded data only. This is a global flag analogous to a compiler default setting.Visual Explanation — Hatch-Boundary Relationship
boundaryRef points to a valid polyline handle. Panel B shows the state after the boundary is erased — the reference becomes a dangling pointer and the hatch border appears dashed to signal the break. Panel C shows the result after recreating a boundary polyline and re-associating the hatch with the new geometry.The diagram above illustrates the three fundamental states a hatch can occupy. In state A, the hatch's internal boundary reference resolves to an existing polyline, and any modification to that polyline — stretching, scaling, or grip-editing — will propagate into the hatch fill. In state B, the boundary object has been deleted (perhaps by an ERASE command or a block explosion), leaving the hatch with a dangling reference. Critically, the hatch still retains embedded coordinate data describing its outline — this is the data that allows boundary recreation. In state C, a new polyline has been generated from that embedded data (or drawn manually to match), and the hatch's boundary reference is updated to point to this new object, restoring full associativity.
How Hatch Boundary Storage Works Internally
Understanding the internal mechanism helps you diagnose issues more effectively. When AutoCAD creates a hatch, it stores boundary information in the DXF group codes of the hatch entity. Specifically, group code 97 specifies the number of source boundary objects, and group code 330 stores the object handles of those boundary entities. Simultaneously, the boundary loop coordinates are stored in group codes 10/20 (vertex X/Y), allowing the hatch to persist even if the referenced objects are removed. This dual-storage design is what makes boundary recreation possible — it is a form of data redundancy built into the DWG file format.
DXF Group Code Structure
| DXF Group Code | Description | Role in Boundary Logic |
|---|---|---|
91 | Number of boundary path loops | Defines how many closed loops (outer + islands) the hatch contains |
92 | Boundary path type flag | Bitfield: 1 = External, 2 = Polyline, 16 = Outermost. Determines loop role. |
10, 20 | Boundary vertex X, Y coordinates | Embedded path data — used for recreation when referenced objects are missing |
97 | Number of source boundary objects | Count of associated geometry handles; 0 means non-associative |
330 | Soft-pointer handle to boundary object | The associative link — when this handle resolves to a valid entity, the hatch is live |
From a computer science perspective, you can model this as a data structure with two parallel representations of the same information. The group code 330 handles act like foreign keys in a relational database — they reference rows (entities) in another table (the drawing database). The group code 10/20 vertices act like a denormalized cache. When the foreign key becomes orphaned (the referenced entity is deleted), the cached vertex data allows you to reconstruct the referenced record — this is the essence of boundary recreation.
HPASSOC to check or toggle the default associativity for new hatches. A value of 1 creates associative hatches; 0 creates non-associative hatches. Existing hatches are unaffected — you must use HATCHEDIT or the Properties palette to change existing associations.Methods for Recreating & Associating Boundaries
AutoCAD provides several pathways to recreate a hatch boundary or associate a hatch with new geometry. The choice of method depends on whether the original boundary still exists (but is disconnected), whether it has been deleted entirely, or whether you want to link the hatch to a different shape altogether. The following diagram outlines the decision tree, and the table below details each approach.
| Method | Command / UI Path | When to Use | Result |
|---|---|---|---|
| Recreate Boundary | Select hatch → Hatch Editor ribbon → Recreate Boundary | Boundary was deleted but hatch retains embedded vertex data | New polyline/region created; hatch optionally associated |
| Associate via HATCHEDIT | HATCHEDIT → Add boundaries | New geometry already exists and you want to link the hatch to it | Hatch boundary reference updated to new object handles |
| Properties Palette Toggle | Select hatch → Properties → Associative: Yes/No | Quick toggle when boundary exists but association flag was turned off | Association re-enabled if valid boundary is detected |
| Manual Draw + Associate | Draw polyline → HATCHEDIT → Add boundary | Hatch needs to fit a redesigned area that differs from the original | Hatch re-fills to match new geometry; old fill data overwritten |
Worked Example — Restoring a Broken Hatch Boundary
Consider the following scenario: you receive a floor plan drawing from a colleague. A concrete hatch pattern (ANSI31) fills a rectangular slab area, but when you try to stretch the slab wall, the hatch does not follow. Inspection reveals that the boundary polyline was accidentally erased during a cleanup pass. Your task is to recreate the boundary and restore associativity.
Associative field. If it reads No or shows a warning icon, the boundary association is broken. You can also confirm at the command line: type LIST and press Enter after selecting the hatch — look for "Associative: No" in the output.Recreate Boundary button in the Boundaries panel. Alternatively, type HATCHEDIT at the command line, select the hatch, then choose the "Recreate Boundary" option.Polyline option. AutoCAD then asks: "Associate hatch with new boundary? [Yes/No] <Yes>:". Press Enter again to accept Yes. This single command both creates the new geometry and establishes the associative link in one operation.Associative field should now read Yes. To test, grip-edit one corner of the new boundary polyline and observe the hatch fill adjusting in real time. If the hatch follows the polyline modification, the association is confirmed to be live.A-FLOR-HBND or a designated boundary layer. Select the new polyline and move it to the appropriate layer using the layer dropdown. Optionally, set this layer to non-plotting so the boundary does not appear on printed sheets while still maintaining the associative link.Associative vs. Non-Associative Hatches — Strengths & Limitations
Choosing between associative and non-associative hatches is not simply a matter of always picking one over the other. Each mode has legitimate use cases, and understanding the trade-offs helps you make informed decisions in production workflows. The table below compares the two modes across several dimensions that matter in real-world CAD projects.
| Criterion | Associative Hatch | Non-Associative Hatch |
|---|---|---|
| Update behavior | Hatch automatically adjusts when boundary geometry changes | Hatch is static; must be re-hatched after geometry changes |
| Fragility | Deleting boundary breaks association (requires recreation) | No dependency on external objects — cannot break |
| File interchange | May break when copying between drawings if handles change | Fully self-contained; copies cleanly across files |
| Editing convenience | High — grip edits propagate; saves significant rework time | Low — every geometry change requires manual hatch update |
| Performance | Slight overhead from maintaining reactive links in large drawings | No reactive computation; marginally better in huge files |
| Best for | Active design phases where geometry is still evolving | Frozen, archived drawings or one-time annotation |
Connection to Advanced Hatch & Boundary Concepts
This introductory lesson focused on single-loop hatch boundaries and the basic recreation workflow. In production drawings, hatch boundaries frequently involve island detection (inner loops that should be excluded from the fill), gap tolerance settings that allow hatching of nearly-closed boundaries, and annotative scaling for hatches that must appear correctly at multiple viewport scales. The table below maps introductory concepts to their advanced counterparts.
| Intro Concept | Advanced Extension | Why It Matters |
|---|---|---|
| Single boundary loop | Multi-loop boundaries with island detection (Normal, Outer, Ignore) | Real floor plans have columns, openings, and nested regions that must be excluded or included |
| Recreate boundary (closed polyline) | Gap tolerance and boundary set management (HPGAPTOL) | Imported geometry often has micro-gaps; tolerance settings allow hatching imperfect boundaries |
| Associativity toggle | Dynamic blocks with hatches and parametric constraints | In parametric design, associative hatches inside dynamic blocks respond to parameter changes |
| Pattern name and scale | Annotative hatch scaling and custom pattern (.PAT) authoring | Annotative hatches auto-scale in viewports; custom patterns encode domain-specific symbology |
| Manual HATCHEDIT workflow | AutoLISP/ObjectARX programmatic hatch creation and boundary management | Scripting hatch operations enables batch processing of hundreds of hatches in large projects |
For computer science students interested in the programmatic side, AutoCAD's .NET API and ObjectARX C++ SDK expose the Hatch class with methods like AppendLoop() and Associative property that let you create, modify, and query hatch boundaries algorithmically. Understanding the manual workflow covered in this lesson is a prerequisite for effectively using these APIs, because the object model mirrors the concepts of boundary loops, path types, and associativity flags directly.
Practice Problems
Recreate Boundary command on each, choosing "Polyline" and "Associate: Yes." How many new polyline objects are created? After the operation, how many of the 45 hatches are now associative, assuming all 33 others were already associative?(entget) and (ssget) functions.Lesson Summary
This lesson introduced the concept of hatch boundary association in AutoCAD — the mechanism by which a hatch object maintains a live reference to the geometry that defines its fill region. We explored how associative hatches store object handles (DXF group code 330) as pointers to boundary geometry, while simultaneously caching embedded vertex data (group codes 10/20) that enables boundary recreation when the original geometry is deleted. The three primary recovery methods were presented: Recreate Boundary for generating new polylines from embedded data, HATCHEDIT re-association for linking to existing geometry, and manual draw-and-associate for redesigned areas.
Key takeaways include the analogy of associative hatches as smart pointers (live references to external objects) versus non-associative hatches as value copies (static snapshots). The HPASSOC system variable controls the default creation mode, and the Properties palette provides a quick diagnostic for checking association status. As you progress to advanced topics — island detection, gap tolerance, annotative scaling, and programmatic hatch management — these foundational concepts will serve as the essential building blocks.