AutoLISP: HEAL – Erase Block & Heal Line

If you have blocks that lie upon a line and where they are on the line it has been trimmed, this routine might be of some use. this routine will let you simply select the block that rests on your line and will delete the block and join the lines into one line.

Here’s how:

  • HEAL2 <enter>
  • Select the block that needs to be erased

that’s it!!!


(defun c:HEAL2 (/ block ll ur objecttojoin)
      (vl-load-com)
      (setq block (car (entsel "\nSelect Block:")))
      (vla-getboundingbox (vlax-ename->vla-object block) 'll 'ur)
      (command "_.erase" block "")
      (setq objecttojoin
                 (ssget "C"
                        (vlax-safearray->list ll)
                        (vlax-safearray->list ur)))
      (command
            "_.join"
            (ssname objecttojoin 0)
            (ssname objecttojoin 1)
            "")
      )

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, Blocks. Bookmark the permalink.

1 Response to AutoLISP: HEAL – Erase Block & Heal Line

  1. Pingback: AutoLISP: Updated Heal Line/Polyline | AutoCAD Tips

Leave a comment