CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 3594 

CAD tip CAD tip # 10269:

Question CAD 
 %  platform  category 
Q - question

How to restore erased hatch boundaries? (multiple)

A - answer 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):

(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)
); end HGB
100% *  CAD 
2.4.2015    5739×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
Tip 12287:AutoCAD hatch flood-fill does not honor all boundaries.
Tip 12129:Atypical use of meshing for tiling a closed shape.
Tip 8396:Ray hatch patterns in AutoCAD.
Tip 8177:How to convert an existing hatch to associative?
Tip 7916:Searching for hatches with missing Area property.

Back   All CAD Tips All CAD tips&tricks

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 glossary   

DwgTextTranslator translates a series of drawings from one language to another using MS Access.
Download a fully functional trial version.

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