CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.096.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator and the updated Barcode generator. New AutoCAD 2026 commands and variables.

CAD tip CAD tip # 10269:

Question

CAD 
 %  platform  category 
A
You can use the AutoCAD command HATCHGENERATEBOUNDARY to batch-edit multiple hatches and restore their (previously deleted) boundary curves in one go. This command is available since version 2011.

For older versions or possible customizations of the boundary-restore procedure you can also use the following LISP utility defining the new custom command HGB (save it as .LSP):

;like HATCHGENERATEBOUNDARY (<2011)
(defun C:HGB ( / ss len n ename oosm ocmd)
 (setq ss (ssget '((0 . "HATCH"))))
 (setq len (sslength ss)  n 0)
 (setq oosm (getvar "osmode") ocmd getvar "cmdecho"))
 (setvar "osmode" 0) (setvar "cmdecho" 0)
 (while (< n len)
  (setq ename (ssname ss n))
  (command "_HATCHEDIT" ename "_B" "" "_Y")
  (setq n (1+ n))
 )
 (setvar "osmode" oosm) (setvar "cmdecho" ocmd)
 (sssetfirst ss ss)
 (princ)
); end HGB
ACAD
100% *CAD
2.4.2015    12300×  
applies to: AutoCAD ·

See also:
Tip 14207:Hatch on path in AutoCAD 2025+
Tip 13590:How to set the hatch background color?
Tip 13150:How to hatch selected objects including overlays and islands?
Tip 12966:TrimArr - trim a dynamic array to a boundary curve.
Tip 12766:Lines with a single grip, incorrect osnaps, intersections, offsets, hatches - CheckLarge


Back    All CAD Tips



Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD: 
OS: 
Categ: 
Text:
 FAQ
  



Featuring:
Publish interactive 3D PDF models from AutoCAD, Inventor or Revit with Share3D More info


Please use these tips at your own risk.
ARKANCE is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist