Originally Posted by
jayhay35365091
Can anybody edit this code to allow multiple selections and window selection?
Try this:
Code:
(Defun c:db ( / pea ss i ll ur objecttojoin)
(setq pea (getvar 'Peditaccept))
(setvar 'Peditaccept 1)
(if (setq ss (ssget "_:L" '((0 . "INSERT"))))
(repeat (setq i (sslength ss))
(vla-getboundingbox (setq e (vlax-ename->vla-object (ssname ss (setq i (1- i))))) 'll 'ur)
(vla-delete e)
(if (Setq objecttojoin (ssget "C"
(vlax-safearray->list ll)
(vlax-safearray->list ur) '((0 . "LWPOLYLINE,LINE"))
))
(command "_.pedit" "_M" objecttojoin "" "_J" "" "")
)
)
)
(setvar 'Peditaccept pea)
(princ)
)
But i would be better if you add the block name in the selection
Code:
(setq ss (ssget "_:L" '((0 . "INSERT")(2 . "Blockname"))))
HTH