;This routine will reverse the order of vertices in any polyline. It ;creates a new polyline at the end of the existing one that has just two ;vertices occupying the same point as the existing end. It then uses ;PEDIT JOIN to accomplish the reversal. If your polylines must not have ;more than one vertex occupying the origin point of the newly ordered ;polyline then don't use this routine or PEDIT the result to remove the ;extra vertices created by this routine. ; ; ; AUTHOR: HENRY C. FRANCIS ; 425 N. ASHE ST. ; SOUTHERN PINES, NC 28387 ; ; All rights reserved without prejudice. ; ; Copyright: 12-3-95 ; Edited: 12-3-95 ; (defun c:plrev ( / plss count exent centh nxent centv cend) (setvar "cmdecho" 0) (setq plss (ssget '((0 . "POLYLINE")))) (setq count (1- (sslength plss))) (while (>= count 0) (setq exent (ssname plss count)) (setq centh (cdr(entget exent))) (setq nxent (entnext exent)) (while (not(eq "SEQEND"(cdr(assoc 0 (entget nxent))))) (setq centv (cdr(entget nxent))) (setq nxent (entnext nxent)) );while (setq cend (list (cons 0 "SEQEND"))) (entmake centh) (entmake centv) (entmake centv) (entmake cend) (command ".pedit" (entlast) "j" exent "" "") (setq count (1- count)) );while (if (>(sslength plss) 1) (prompt (strcat "\n" (rtos(sslength plss)2 0) " polylines have been reversed. ")) (prompt "\nPolyline has been reversed. ") );if (princ) );defun