Hi Nikon
If you explode a lwpolyline you will have a line. So you just have to break it up and delete the original.
Simply replace '(command "_.JOIN" ent1 ent2 "")' with the code I have attached
(progn
(if (= (cdr (assoc 0 (entget ent1))) "LWPOLYLINE")
(setq ent (vlax-vla-object->ename (car (vlax-safearray->list (vlax-variant-value (vla-explode (vlax-ename->vla-object ent1))))))
x (vla-delete (vlax-ename->vla-object ent1))
ent1 ent
)
)
(if (= (cdr (assoc 0 (entget ent2))) "LWPOLYLINE")
(setq ent (vlax-vla-object->ename (car (vlax-safearray->list (vlax-variant-value (vla-explode (vlax-ename->vla-object ent2))))))
x (vla-delete (vlax-ename->vla-object ent2))
ent2 ent
)
)
(command "_.JOIN" ent1 ent2 "")
)
what about insert the new block to the drawing,
bcause a block with that name already exist,
you will be sasked if you want to re-dfine it,choose yes.
if you have attributes with that block use attsync command,choose the new block you have just inserted as the block to sync.
hope it will help.
aridzv.