;;;CREATE A NEW POLYLINE FROM AN OLD POLYLINE W/ REVERSED ORDER VERTICES. ;;; ;;; IT USES A SCRIPT FILE ;;; CONTAINING THE VERTEX POINTS SORTED IN DECENDING ORDER. ;;; THE ORIGINAL POLYLINE MUST ADVANCE CONTINUALLY ALONG THE X AXIS ;;; IN THE COORDINATE SYSTEM USED. ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 9-23-93 ;;;> EDITED: 04-08-1997 ;;; (defun c:npl ( / ptlst prgp ptg1) ;find another (setq prgp (car (entsel "\nSelect Existing Grade Polyline "))) (setq datf (open "-npl.scr" "w")) (write-line ".pline" datf) (while ;ground segment (not (eq (cdr (assoc 0 (entget (entnext prgp)))) "SEQEND")) (setq prgp (entnext prgp)) (if (setq ptg1 (cdr (assoc 10 (entget prgp)))) (progn (setq ptg1x (rtos (car ptg1))) (setq g1xsl (strlen ptg1x)) (setq ptg1y (rtos (cadr ptg1))) (setq g1ysl (strlen ptg1y)) (if (= g1xsl 3) (setq ptg1x (strcat "00000" ptg1x)) (if (= g1xsl 4) (setq ptg1x (strcat "0000" ptg1x)) (if (= g1xsl 5) (setq ptg1x (strcat "000" ptg1x)) (if (= g1xsl 6) (setq ptg1x (strcat "00" ptg1x)) (if (= g1xsl 7) (setq ptg1x (strcat "0" ptg1x)) );if );if );if );if );if (if (= g1ysl 3) (setq ptg1y (strcat "0000" ptg1y)) (if (= g1ysl 4) (setq ptg1y (strcat "000" ptg1y)) (if (= g1ysl 5) (setq ptg1y (strcat "00" ptg1y)) (if (= g1ysl 6) (setq ptg1y (strcat "0" ptg1y)) (if (= g1ysl 7) (setq ptg1y (strcat "0" ptg1y)) );if );if );if );if );if (setq ptlst (strcat ptg1x "," ptg1y)) (write-line ptlst datf) );progn );if );while (close datf) (command ".sh" "sort < -npl.scr > -pl.scr" ) (graphscr) (command ".script" "-pl.scr") );defun c:npl