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)
            "")
      )
Advertisements

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.

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

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

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s