• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

HATCHCLEAR LISP: Clear Hatch From Behind Text in AutoCAD

August 3, 2026

HATCHCLEAR clears hatching from behind text so buried annotation becomes readable again. Select the text and the offending hatch, and the hatch gains a new island boundary around each piece of text — genuinely cutting the pattern away rather than masking it, so it stays correct when plotted.

What HatchClear does

It also reaches text inside blocks, including attributes, and blocks nested inside other blocks to any depth. That is what makes it useful in practice, because it is almost always a block’s label that ends up buried under hatching.

A real island boundary is different from a background mask. The mask sits on top and can plot as a solid block if it is coloured; a boundary removes the pattern from the hatch itself, so what plots is what you see.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type HATCHCLEAR.
  3. Select the text — plain text, or blocks containing it.
  4. Select the hatch to cut away.

How it works

A hatch boundary cannot reference an object inside a block. That is the constraint the whole routine works around.

So for nested text, the routine recreates that text temporarily as a normal top-level object, positioned exactly where the nested original appears, adds the boundary from it, and then deletes the temporary copy.

The consequence is unavoidable and worth knowing before you run it. Adding a boundary from an object that is then deleted forces the hatch to become non-associative. So if any blocks are included in the selection, the hatch will no longer follow its original boundary if that boundary is later edited. Selecting only plain text keeps the hatch associative.

Invisible attributes and objects hidden by DXF group 60 are skipped, since carving a hole for text nobody can see would only put an unexplained gap in the hatch.

Notes and limits

  • Including blocks costs associativity. Plain text only keeps the hatch associative; blocks force it non-associative. That is a property of how AutoCAD boundaries work, not a shortcut in the routine.
  • This cuts the hatch, it does not mask it. The result plots as it appears.
  • Invisible text is skipped deliberately, so no unexplained gaps appear.
  • One undo group covers the whole operation.

Download and details

NameHatchClear — clear hatching from behind text so it becomes readable
DownloadHatchClear.lsp — 15.6 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandHATCHCLEAR
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size15.6 KB, 405 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoThe whole operation is wrapped in a single undo group, so one U reverses all of it.
CompatibilityAutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer.
AuthorYZ, August 2026
LicenceFree to use, supplied “as is” with no warranty.

References

  • BACKDROP LISP — the masking approach, when cutting the hatch is not wanted
  • TEXTFRAME LISP — draw a frame around text instead
  • More free AutoLISP routines on this site
  • Wisey’s Steel Shapes — free structural steel section drawing program

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in