PROGRAM : CRTPL.LSP WRITER : Jos van Doorn DATE : 09.05.01 DESCRIPTION : The program runs through the database of the drawing. If it finds a line or an arc then it's turned into a polyline together with all the lines and arcs that are connected to it. Load the program in AutoCAD and start it with giving CRTPL at the command prompt. No prompts or dailog boxes will apear. The program runs automatically. (defun fndss () (setq et (entnext) ss (ssadd) ) (while et (setq el (entget et) tp (cdr (assoc 0 el)) ) (if (or (= tp "LINE") (= tp "ARC")) (setq ss (ssadd et ss)) ) (setq et (entnext et)) ) ss ) (defun crtpl () (setq et (entnext)) (while et (setq el (entget et) tp (cdr (assoc 0 el)) ) (if (or (= tp "LINE") (= tp "ARC")) (progn (setq fe et ss (fndss) ) (if (> (sslength ss) 0) (command "pedit" fe "" "j" ss "" "") ) (setq et nil) ) (setq et (entnext et)) ) ) ) (defun cntla () (setq et (entnext) at 0 ) (while et (setq el (entget et) tp (cdr (assoc 0 el)) ) (if (or (= tp "LINE") (= tp "ARC")) (setq at (1+ at)) ) (setq et (entnext et)) ) at ) (defun c:crtpl () (setvar "cmdecho" 0) (setq at (cntla)) (while (> at 0) (crtpl) (setq at (cntla)) ) (princ) )