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.
- HEAL <enter>
- Select the block that needs to be erased
(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) )