Drafting & Hatching

How to Fix Hatch Pattern Too Dense, Solid Black, or Boundary Not Closed Errors

Solve 'Hatch spacing too dense', solid-fill appearance, gap tolerance failures, and shattered hatch patterns far from WCS origin in GstarCAD 2027 and AutoCAD.

⚡ Quick Executive Fix

Check MEASUREMENT (0 = Imperial ANSI, 1 = Metric ISO) so ANSI31 isn't scaled in millimeters, adjust HPGAPTOL to bridge small boundary micro-gaps, and run HATCHSETORIGIN (or SNAPBASE) if hatching at large civil coordinates freezes or shatters.

1. Engineering Root-Cause Diagnosis inside the AC1032 DWG Database

Hatching failures in AC1032 DWG drawings stem from three mathematical mismatches: (1) mixing **Imperial `.pat` definitions** (`ANSI31` defined at `0.125` inch spacing) inside a **Metric millimeter drawing** (`MEASUREMENT = 1`), creating 100,000+ microscopic lines; (2) unclosed boundary micro-gaps where endpoint coordinates differ by `0.05 mm`; and (3) **IEEE 754 floating-point precision loss** when evaluating hatch dash arrays at civil coordinates (`X > 500,000`).

2. Step-by-Step Resolution Protocol in AutoCAD & GstarCAD 2027

1. Align MEASUREMENT with Your Drawing Units (ANSI vs. ISO)

Type MEASUREMENT. Set to 1 for metric drawings (loads `gcadiso.pat` / `acadiso.pat`) or 0 for imperial inch drawings. If using `ANSI31` in a millimeter drawing, set Hatch Scale to 25.4–100.

2. Bridge Unclosed Micro-Gaps via HPGAPTOL

Set HPGAPTOL = 2.0 (in drawing units, e.g., 2 mm) so the planar ray-casting boundary solver automatically bridges small corner gaps between unjoined lines.

3. Fix Shattered / Disjointed Hatches at Large Coordinates

If concrete (`AR-CONC`) or gravel hatches break into random lines on civil survey plans, click Set Origin in the Hatch Contextual Ribbon (or set HPORIGIN to a corner of the local object) to anchor the `.pat` dash matrix locally.

4. Adjust HPMAXLINES & HPMAXAREAS Safety Caps

If a valid large site hatch says 'Hatch spacing too dense', increase HPMAXLINES from its default (`100000` or `1000000`) up to `5000000`.

3. Automated AutoLISP Diagnostic & Repair Script (C:FIXBROKENHATCH)

Load the following production AutoLISP routine into GstarCAD 2027 or AutoCAD via APPLOAD (or add it to gcaddoc.lsp) to automate this repair across affected project files:

(defun C:FIXBROKENHATCH ( / ss i ent obj extMin extMax)
  (vl-load-com)
  (princ "\nSelect shattered hatches at large coordinates to reset local origin: ")
  (if (setq ss (ssget '((0 . "HATCH"))))
    (repeat (setq i (sslength ss))
      (setq ent (ssname ss (setq i (1- i)))
            obj (vlax-ename->vla-object ent))
      (vla-GetBoundingBox obj 'extMin 'extMax)
      (setq extMin (vlax-safearray->list extMin))
      (vla-put-Origin obj (vlax-3d-point (car extMin) (cadr extMin) 0.0))
      (vla-Evaluate obj)
    )
  )
  (princ "\nReset hatch origins to local bounding-box corners.")
  (princ)
)

4. Diagnostic System Variables & Edge-Case Matrix

Failure Symptom / Scenario Command / SysVar Production Remediation Rule
Hatch looks like a solid black blob HPSCALE / MEASUREMENT ANSI pattern used in mm drawing at Scale=1. Increase scale to 25.4+.
AR-CONC pattern shatters into stray lines HPORIGIN / Set Origin Object is millions of units from 0,0,0; snap Hatch Origin to local corner.
'A closed boundary could not be determined' HPGAPTOL & Zoom Extents Ensure the entire boundary is visible on screen during Pick Points and raise HPGAPTOL.

Experience Faster, Corruption-Free DWG Engineering in GstarCAD 2027

Built by Suzhou Gstarsoft Co., Ltd. (SSE: 688657), GstarCAD 2027 features multi-threaded DWG open/save, built-in RegApp/Scale-List scrubbers, and perpetual licensing.

Download GstarCAD 2027 Free Trial → AutoCAD Migration Hub