AutoLISP: Change Hatches to Solid Hatches

Today’s featured routine will help you if you need to change some or all hatches to the solid hatch pattern.

Here’s how:

  • HATCH2SOLID <enter>
  • Create a selection set by either individual selection or window/crossing selection.
  • Or
  • As shown in the animation: type ALL <enter> in the command line to select all hatches in the drawing.
  • Hit <enter> once more to except the selection set.


(defun c:Hatch2Solid (/ ss)
;;; Tharwat 01. April. 2012 ;;;
  (cond ((not acdoc)
         (setq acdoc (vla-get-activedocument (vlax-get-acad-object)))
  (if (setq ss (ssget "_:L" '((0 . "HATCH") (2 . "~SOLID"))))
      (vla-StartUndoMark acdoc)
      ((lambda (i / sn)
           (setq sn (ssname ss (setq i (1+ i))))
              (vlax-ename->vla-object sn)
      (vla-EndUndoMark acdoc)

About AutoCAD Tips

This blog serves as a knowledge base for myself (and anyone else) so that I can reference tips & tricks that I have learned and also refer others to it as well. I hope that this blog helps you learn at least one tip to make your drafting/design experience better.
This entry was posted in AutoLISP, AutoLISP: Modify, Hatch, Modifying. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s