Just like the previous post that heals lines, this routine will work on polylines.
it will erase the selected block and then join the two polylines into one.
Note: If the block is placed on a curved segment of a polyline, the joined area/distance will be made as a straight polyline segment.
There are 2 advantages of using this version over the routine that only works with lines:
1) The polyline routine lets you select any other type of object as well as polylines. And these objects will be turned into polylines.
2) It will join segments even when the block is obscuring the vertex (corner). the line routine will not do this.
Here’s how:
- HEAL <enter>
- Select the block that needs to be erased
That’s it
(defun c:heal (/ block ll ur p1 p2) (vl-load-com) (setq block (car (entsel "\nSelect Block:"))) (vla-getboundingbox (vlax-ename->vla-object block) 'll 'ur) (command "_.erase" block "") (command "_.pedit" "_m" (ssget "C" (setq p1 (vlax-safearray->list ll)) (setq p2 (vlax-safearray->list ur))) "" "_join" "_Joint" "_Both" (distance p1 p2) "") (princ) )
I am actually looking for the opposite. If i insert a block on the polyline then it’d create two separate pieces. Anybody has any solution?
Pingback: AutoLISP: Updated Heal Line/Polyline | AutoCAD Tips
Sir Good morning (Dubai).Sir this command dont work in Autocad 2014.
how to work. heal command.
AutoLISP: Heal – Erase Block & Heal Polyline
Try this updated version: https://autocadtips.wordpress.com/2014/11/12/autolisp-updated-heal-linepolyline/