AUTOCAD • ANNOTATION AND DOCUMENTATION

Hatch Boundary Association — Recreate/associate hatch boundaries with new geometry (intro)

Master how AutoCAD links hatch patterns to enclosing geometry and how to restore or reassign lost boundaries.

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.

1982
AutoCAD Release 1
Hatching required manual selection of individual boundary segments. No association existed between the hatch and its boundary geometry — changes meant redoing the entire hatch.
1997
AutoCAD R14 — Associative Hatch
Autodesk introduced associative hatching, linking hatch objects to their boundary polylines. Modifying the boundary now automatically updated the hatch fill, a paradigm shift for documentation workflows.
2005
AutoCAD 2006 — Hatch Enhancements
The HATCHEDIT command gained the ability to recreate boundaries from existing hatch objects and to add or remove boundary loops, giving users tools to repair broken associations.
2011
AutoCAD 2011 — Contextual Ribbon
The Hatch Editor contextual ribbon tab streamlined boundary recreation and association. Users could now visually select new boundaries and toggle associativity with a single click.
2020+
Modern AutoCAD — Boundary Tolerance
Recent releases improved gap-tolerance settings and island detection, making boundary recreation more robust when geometry is not perfectly closed — a direct response to real-world BIM and documentation interop challenges.

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.

1

Associative Hatch

A hatch whose boundary paths store object handles pointing to existing geometry. When that geometry changes, the hatch recomputes its fill. Think of it as a live reference — analogous to a pointer in C++ rather than a copied value.
2

Non-Associative Hatch

A hatch that stores its boundary as embedded coordinate data. It is a deep copy of the boundary at creation time. Editing surrounding geometry has no effect on the hatch, similar to passing by value.
3

Boundary Recreation

The process of generating a new polyline or region object from the hatch's internal boundary data. AutoCAD traces the stored path coordinates and creates visible geometry — useful when the original boundary has been deleted.
4

Boundary Association

The act of linking an existing hatch to a new set of boundary objects. The old boundary references are replaced by handles to the new geometry, restoring live update behavior.
5

HATCHASSOCIATIVITY System Variable

Controls the default creation mode. When set to 1, new hatches are associative. When 0, they store embedded data only. This is a global flag analogous to a compiler default setting.
KEY TAKEAWAY
Think of an associative hatch like a smart pointer in C++: it references external boundary objects and updates when they change. A non-associative hatch is like a raw copy — it captured boundary coordinates at creation and never looks back. Boundary recreation is essentially deserializing that embedded data back into visible geometry, while re-association is updating the pointer to reference new objects.

Visual Explanation — Hatch-Boundary Relationship

Panel A shows a healthy associative hatch whose internal 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

Key DXF group codes governing hatch boundary storage and association
DXF Group CodeDescriptionRole in Boundary Logic
91Number of boundary path loopsDefines how many closed loops (outer + islands) the hatch contains
92Boundary path type flagBitfield: 1 = External, 2 = Polyline, 16 = Outermost. Determines loop role.
10, 20Boundary vertex X, Y coordinatesEmbedded path data — used for recreation when referenced objects are missing
97Number of source boundary objectsCount of associated geometry handles; 0 means non-associative
330Soft-pointer handle to boundary objectThe 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.

System Variable Reference
Use 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.

The decision flowchart shows three pathways to restore a hatch boundary association: re-associating with an existing boundary (Method 1), recreating a boundary from embedded hatch data (Method 2), or manually drawing new geometry and linking it (Method 3).
Summary of methods for boundary recreation and re-association
MethodCommand / UI PathWhen to UseResult
Recreate BoundarySelect hatch → Hatch Editor ribbon → Recreate BoundaryBoundary was deleted but hatch retains embedded vertex dataNew polyline/region created; hatch optionally associated
Associate via HATCHEDITHATCHEDIT → Add boundariesNew geometry already exists and you want to link the hatch to itHatch boundary reference updated to new object handles
Properties Palette ToggleSelect hatch → Properties → Associative: Yes/NoQuick toggle when boundary exists but association flag was turned offAssociation re-enabled if valid boundary is detected
Manual Draw + AssociateDraw polyline → HATCHEDIT → Add boundaryHatch needs to fit a redesigned area that differs from the originalHatch re-fills to match new geometry; old fill data overwritten
💡 Polyline vs. Region
When recreating a boundary, AutoCAD prompts you to choose between a polyline and a region. Polylines are more common in 2D documentation workflows because they are lightweight and easy to edit. Regions are surface-based objects that support Boolean operations and are more useful in 3D modeling contexts. For annotation and documentation purposes, polylines are almost always the right choice.

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.

Recreating and Re-Associating a Concrete Slab Hatch
1
Step 1 — Verify the Association StatusSelect the hatch object by clicking on it. Open the Properties palette (Ctrl+1). Under the "Hatch" section, find the 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.
Confirmed: Associative = No; boundary handle references are invalid.
2
Step 2 — Invoke Recreate BoundaryWith the hatch still selected, the Hatch Editor contextual tab appears on the ribbon. Click the Recreate Boundary button in the Boundaries panel. Alternatively, type HATCHEDIT at the command line, select the hatch, then choose the "Recreate Boundary" option.
AutoCAD prompts: "Enter type of boundary object [Region/Polyline] <Polyline>:"
3
Step 3 — Choose Boundary Type and AssociationPress Enter to accept the default 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.
A new polyline is created tracing the hatch outline; the hatch's group code 330 now references this polyline's handle.
4
Step 4 — Verify the Restored AssociationSelect the hatch again and check the Properties palette. The 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.
Associative = Yes. Hatch dynamically updates when boundary is modified. ✓
5
Step 5 — Clean Up Layer PlacementThe recreated polyline inherits the current layer. In a well-organized drawing, boundary geometry should reside on a layer like 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.
Boundary polyline placed on A-FLOR-HBND (no-plot). Drawing is clean and maintainable.

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.

Comparison of associative and non-associative hatch modes
CriterionAssociative HatchNon-Associative Hatch
Update behaviorHatch automatically adjusts when boundary geometry changesHatch is static; must be re-hatched after geometry changes
FragilityDeleting boundary breaks association (requires recreation)No dependency on external objects — cannot break
File interchangeMay break when copying between drawings if handles changeFully self-contained; copies cleanly across files
Editing convenienceHigh — grip edits propagate; saves significant rework timeLow — every geometry change requires manual hatch update
PerformanceSlight overhead from maintaining reactive links in large drawingsNo reactive computation; marginally better in huge files
Best forActive design phases where geometry is still evolvingFrozen, archived drawings or one-time annotation
KEY TAKEAWAY
Think of associative hatches like reactive state bindings in a frontend framework (React, Vue): when the source data (boundary geometry) changes, the derived view (hatch fill) updates automatically. Non-associative hatches are like rendering a static snapshot — fast and reliable, but you have to manually re-render whenever the data changes. In collaborative development environments where the "source" is frequently modified, reactive bindings (associative mode) are almost always preferred.

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.

Mapping introductory concepts to advanced hatch topics
Intro ConceptAdvanced ExtensionWhy It Matters
Single boundary loopMulti-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 toggleDynamic blocks with hatches and parametric constraintsIn parametric design, associative hatches inside dynamic blocks respond to parameter changes
Pattern name and scaleAnnotative hatch scaling and custom pattern (.PAT) authoringAnnotative hatches auto-scale in viewports; custom patterns encode domain-specific symbology
Manual HATCHEDIT workflowAutoLISP/ObjectARX programmatic hatch creation and boundary managementScripting 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

PROBLEM 1CONCEPTUAL
Explain the difference between an associative hatch and a non-associative hatch in terms of how boundary data is stored. Why does AutoCAD store both object handles and embedded vertex coordinates for an associative hatch, rather than relying solely on the object handles?
PROBLEM 2BASIC CALCULATION
You have a drawing with 45 hatch objects. After a colleague explodes several blocks, 12 hatches lose their boundary associations. You use the 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?
PROBLEM 3INTERMEDIATE
You select a hatch and use the LIST command. The output shows "Associative: No" and lists 0 source boundary objects (group code 97 = 0). However, the hatch still displays correctly on screen. Describe the step-by-step procedure to restore this hatch to an associative state with a new boundary. What would happen differently if group code 97 showed a nonzero value but the referenced handles were invalid?
PROBLEM 4APPLIED
You are developing an AutoLISP script that audits a large construction drawing (800+ hatch objects) and reports all hatches with broken boundary associations. Describe in pseudocode how you would iterate over all entities, identify hatch objects, check their associativity status, and generate a report listing entity handles and layer names for all non-associative hatches. Assume you have access to (entget) and (ssget) functions.
PROBLEM 5CRITICAL THINKING
AutoCAD's dual-storage design (object handles + embedded vertices) for associative hatches introduces data consistency challenges. Propose a scenario where the embedded vertex data and the actual boundary geometry could become desynchronized, and explain the consequences. Then, design a validation algorithm that detects such inconsistencies and describe its time complexity in terms of the number of boundary vertices V and the number of hatch objects H.

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.

Varsity Tutors • AutoCAD • Hatch Boundary Association — Recreate/associate hatch boundaries with new geometry (intro)