;Copywrite 2006, CAD MASTERS INC. ;Joins line, arc, or polyline to other lines, arcs and polylines ;given AutoCAD's ALL selection algorithm, dosn't work with noun-verb ;If a polyline it must be touching other entities (defun c:pej(/ a b c) (prompt "\nSelect line, arc, or polyline to join to") (setvar "cmdecho" 0) (setq a (entsel)) (setq b (car a)) (setq c (entget b)) (if (= (cdr (assoc 0 c)) "LWPOLYLINE") (progn (command "_explode" a) (command "PEDIT" (SSGET "_P") "Y" "J" "ALL" "" "") ) (command "PEDIT" a "Y" "J" "ALL" "" "") ) (setvar "cmdecho" 1) )