;;;Label contour polylines with their elevation. ;;; ;;; AUTHOR: HENRY C. FRANCIS ;;; 425 N. ASHE ST. ;;; SOUTHERN PINES, NC 28387 ;;; ;;; All rights reserved without prejudice. ;;; ;;; Copyright: 3-16-96 ;;; Edited: 5-1-2000 ;;; (defun c:clbl (/); line1 line2 pt1 pt2 pt3 pt4 (c:svlayr) (setq osnap_mode (getvar"osmode")) (setvar "osmode" 0) (while (setq nent (nentsel "\nPick contour at point to label")) (if dimscl nil (load"dimscl")) (dimscl) (if (>(getvar"viewtwist")0) (setq txt_twst (-(* pi 2)(getvar "viewtwist"))) (setq txt_twst (getvar "viewtwist")) ) (setq pt0 (nth 1 nent) line1 (entget(car nent)) pt1 (cdr(assoc 10 line1)) txtht (* 0.0875 dimsc) conti (fix(caddr pt1)) contz (itoa conti) nent_layr (cdr(assoc 8 line1)) pt2 (cond ((eq "VERTEX"(cdr(assoc 0 line1))) (cdr(assoc 10(entget(entnext(cdr(assoc -1 line1))))))) ((eq "LINE"(cdr(assoc 0 line1))) (cdr(assoc 11 line1))) );cond ) (setq lang (angle pt1 pt2)) (setq chkang (+ lang (getvar"viewtwist"))) (if (or (and(> chkang 1.8675)(< chkang 5.009)) (and(> chkang (+(* 2 pi)1.8675))(< chkang (+(* 2 pi)5.009))) ) (setq txang (*(/(+ pi lang)2 pi)360)) (setq txang (*(/ lang 2 pi)360)) );if (setq pt0 (trans(list(car pt0)(cadr pt0))0 1) pt1 (trans(list(car pt1)(cadr pt1))0 1) pt2 (trans(list(car pt2)(cadr pt2))0 1) pt0 (polar pt1 (angle pt1 pt2)(distance pt1 pt0)) mjrg "C" llt (if(or(wcmatch (STRCASE nent_layr) "CSTTPX##|*") (wcmatch (STRCASE nent_layr) "CSTECX##|*") ) "E" "-" ) prod "CONT" colr (if(or(wcmatch (STRCASE nent_layr) "CSTTPX##|*") (wcmatch (STRCASE nent_layr) "CSTECX##|*") ) "7" "2" ) );setq (cond ((eq(rem conti 10)0) (setq modf "TX10")) ((eq(rem conti 5)0) (setq modf "TX05")) ((eq(rem conti 2)0) (setq modf "TX02")) ((setq modf "TX01")) );cond (setq dont_ask_ltyp T) (c:mklayr) (setq dont_ask_ltyp NIL) (command ".text" "j" "mc" pt0 txtht txang contz) (setq cltxt (entget(entlast)) cltxt (subst (cons 51 0.2618) (assoc 51 cltxt) cltxt ) );setq (entmod cltxt) );while (c:rslayr) (setvar "osmode" osnap_mode) (princ) );defun