;;;Extracts data and creates polylines to replace a rather ;;;bothersome water surface block received from outside sources. ;;; ;;; Author: ;;; Henry C. Francis ;;; 425 N. Ashe St. ;;; Southern Pines, NC 28387 ;;; ;;; All rights reserved. ;;; ;;; Copyright: 9-20-99 ;;; Edited: 9-20-99 ;;; (DEFUN c:waterpl () (SETQ insnam "WATER1234") (SETVAR "cmdecho" 0) (WHILE (and insnam (wcmatch insnam "WATER###*")) (IF (SETQ wtrent (ENTSEL "\nSelect Water Block: ")) (PROGN (SETQ selent (ENTGET (CAR wtrent))) (IF (EQ (CDR (ASSOC 0 selent)) "INSERT") (SETQ insnam (CDR (ASSOC 2 selent))) (SETQ insnam nil) ) ;_ end of if ) ;_ end of progn (SETQ insnam nil) ) ;_ end of if (IF insnam (PROGN (SETQ blklst nil) (SETQ blkent (TBLSEARCH "block" insnam) nxtent (ENTGET (CDR (ASSOC -2 blkent))) ) ;_ end of setq (WHILE (AND nxtent (/= (CDR (ASSOC 0 nxtent)) "SEQEND")) (IF (EQ (CDR (ASSOC 0 nxtent)) "LINE") (PROGN (IF (EQ last11 (ASSOC 10 nxtent)) nil (SETQ blklst (APPEND (LIST (CONS 10 (CDR (ASSOC 10 nxtent)))) blklst)) ) ;_ end of IF (SETQ blklst (APPEND (LIST (CONS 10 (CDR (ASSOC 11 nxtent)))) blklst)) (SETQ last11 (ASSOC 11 nxtent)) ;;; (princ "\n") ;;; (princ nxtent) ) ;_ end of progn ) ;_ end of if (IF (SETQ nxtent (ENTNEXT (CDR (ASSOC -1 nxtent)))) (SETQ nxtent (ENTGET nxtent)) ) ;_ end of if ) ;_ end of while (ENTMAKE (REVERSE (CDR (REVERSE blkent)))) (ENTMAKE (LIST (CONS 0 "POLYLINE") (CONS 8 "WATER") (CONS 10 (LIST 0 0 0)) (CONS 66 1) (CONS 70 128) ) ;_ end of list ) ;_ end of entmake (FOREACH n blklst(ENTMAKE(LIST(CONS 0 "VERTEX")(CONS 8 "WATER")(CONS 10 (CDR n))))) (ENTMAKE (LIST (CONS 0 "SEQEND"))) (ENTMAKE (LIST (CONS 0 "POLYLINE") (CONS 8 "WATER-FLT-NPLT") (CONS 10 (LIST 0 0 0)) (CONS 66 1) (CONS 70 136) ) ;_ end of list ) ;_ end of entmake (FOREACH n blklst(ENTMAKE(LIST(CONS 0 "VERTEX")(CONS 8 "WATER")(CONS 70 32)(CONS 10 (CDR n))))) (ENTMAKE (LIST (CONS 0 "SEQEND"))) (ENTMAKE (LIST (CONS 0 "ENDBLK"))) (ENTUPD (CDR (ASSOC -1 selent))) (COMMAND ".undo" "mark") ) ;_ end of progn ) ;_ end of if ) ;_ end of while ) ;_ end of defun ;|«Visual LISP© Format Options» (120 2 15 2 T "end of " 100 9 2 0 nil nil nil T T) ***Don't add text below the comment!***|;