;;;Format and place a curve table using current style settings ;;;to fix the size of the table. The number of decimal ;;; places is determined by the UNITS settings. ;;; ;;; AUTHOR: Henry C. Francis ;;; 425 N. Ashe Street ;;; Southern Pines, NC 28387 ;;; ;;; Copyright: 3-11-1992 ;;; Edited: 4-8-2001 ;;; (defun C:CTBL (/ cent arad sang eang cang arcl txsz radl tp1 tp2 tp3 tp4 tp5 tp6 cnt lp0 lp1 lp2 lp3 lp4 lp5 lp6 vp1 vp2 vp3 vp4 vp5 bp1 bp2 bp3 bp5 atyp mode prec ) ; (setq dimsc (getvar"dimscale")) (if dimscl nil (load "dimscl") ) ;_ end of if (dimscl) (setq txht (getvar "textsize")) (setvar "cmdecho" 0) (if getstyle (getstyle "A") (progn (load "getstyle") (getstyle "A")) ) ;_ end of if (setq tp1 nil cnt 0 ) ;_ end of setq (setvar "cecolor" "bylayer") (setq atyp (ukword 1 "DEgrees DMs Grads Rads Surveyor's" "\Select angle readout (DEgrees/DMs/Grads/Rads/Surveyor's)" "DM" ) ;_ end of ukword ) ;_ end of setq (if (or (= atyp "DEgrees") (= atyp "DE")) (setq mode 0 prec 2 ) ;_ end of setq (if (or (= atyp "DMs") (= atyp "DM")) (setq mode 1 prec 4 ) ;_ end of setq (if (or (= atyp "Grads") (= atyp "G")) (setq mode 2 prec 2 ) ;_ end of setq (if (or (= atyp "Rads") (= atyp "R")) (setq mode 3 prec 2 ) ;_ end of setq (if (or (= atyp "Surveyor's") (= atyp "S")) (setq mode 4 prec 4 ) ;_ end of setq (setq prec 2) ) ;if ) ;if ) ;if ) ;if ) ;if (while (setq cent (car (entsel "\nPick curve for curve table: "))) (if (equal (cdr (assoc 0 (entget cent))) "ARC") (progn (setq arad (cdr (assoc 40 (entget cent))) sang (cdr (assoc 50 (entget cent))) eang (cdr (assoc 51 (entget cent))) txsz (* dimsc 0.0875) txsz2 (* dimsc 0.0875 1.4) ) ;setq (if (> sang eang) (setq cang (+ (- (* 2 pi) sang) eang)) (setq cang (- eang sang)) ) ;if (setq arcl (strcat (rtos (* cang arad)) "'") radl (strcat (rtos arad) "'") tanl (strcat (rtos (* (/ arad (cos (/ cang 2.0))) (sin (/ cang 2.0))) ) ;_ end of rtos "'" ) ;_ end of strcat cang (angtos cang mode prec) ) ;setq (if (= (substr cang 2 1) "d") (setq cang (strcat (substr cang 1 1) "%%d" (substr cang 3))) (if (= (substr cang 3 1) "d") (setq cang (strcat (substr cang 1 2) "%%d" (substr cang 4)) ) ;_ end of setq (if (= (substr cang 4 1) "d") (setq cang (strcat (substr cang 1 3) "%%d" (substr cang 5)) ) ;_ end of setq (if (= (substr cang 5 1) "d") (setq cang (strcat (substr cang 1 3) "%%d" (substr cang 6) ) ;_ end of strcat ) ;_ end of setq (if (= (substr cang 6 1) "d") (setq cang (strcat (substr cang 1 3) "%%d" (substr cang 7) ) ;_ end of strcat ) ;_ end of setq (if (= (substr cang 7 1) "d") (setq cang (strcat (substr cang 1 3) "%%d" (substr cang 8) ) ;_ end of strcat ) ;_ end of setq ) ;if ) ;if ) ;if ) ;if ) ;if ) ;if (if tp1 (setq tp1 (polar tp1 (* 1.5 pi) (* 3.0 txsz))) (setq tp1 (upoint 1 "" "\nStart point of curve table" nil nil) ) ;_ end of setq ) ;if (setq tp2 (polar tp1 0 (* 12.0 txsz)) tp3 (polar tp2 0 (* 12.0 txsz)) tp4 (polar tp3 0 (* 12.0 txsz)) tp6 (polar tp4 0 (* 12.0 txsz)) tp5 (polar tp1 (/ pi 2) (/ txsz 2)) lp1 (polar (polar tp5 pi (* 6 txsz)) (/ pi 2) (* 1.5 txsz)) lp2 (polar lp1 0 (* 60 txsz)) lp3 (polar lp1 (* 1.5 pi) (* 3 txsz)) lp4 (polar lp2 (* 1.5 pi) (* 3 txsz)) lp5 (polar (polar lp1 0 (* 30 txsz)) (/ pi 2) (* 1.5 txsz)) cnt (1+ cnt) ) ;_ end of setq :setq (if lp0 nil (setq lp0 (polar lp1 (/ pi 2) (* 4 txsz)) vp1 (polar lp1 0 (* 12 txsz)) vp2 (polar vp1 0 (* 12 txsz)) vp3 (polar vp2 0 (* 12 txsz)) vp5 (polar vp3 0 (* 12 txsz)) vp4 (polar lp0 0 (* 60 txsz)) ) ;setq ) ;if (if (= cnt 1) (progn (setq colr "4") (c:mklayr) (command ".text" "c" lp5 txsz2 0 "CURVE TABLE") (setq colr "2") (c:mklayr) (command ".text" "c" tp1 txsz 0 "CURVE" ".text" "c" tp2 txsz 0 "ARC ANGLE" ".text" "c" tp3 txsz 0 "RADIUS" ".text" "c" tp4 txsz 0 "TANGENT" ".text" "c" tp6 txsz 0 "LENGTH" ) ;_ end of command ;command (setq colr "4") (c:mklayr) (command ".line" lp1 lp2 "" ".line" lp3 lp4 "") ;_ end of command ;command (setq tp1 (polar tp1 (* 1.5 pi) (* 3.0 txsz)) tp2 (polar tp1 0 (* 12.0 txsz)) tp3 (polar tp2 0 (* 12.0 txsz)) tp4 (polar tp3 0 (* 12.0 txsz)) tp6 (polar tp4 0 (* 12.0 txsz)) tp5 (polar tp1 (/ pi 2) (/ txsz 2)) lp3 (polar (polar (polar tp5 pi (* 6 txsz)) (/ pi 2) (* 1.5 txsz) ) ;_ end of polar (* 1.5 pi) (* 3 txsz) ) ;_ end of polar lp4 (polar (polar (polar (polar tp5 pi (* 6 txsz)) (/ pi 2) (* 1.5 txsz) ) ;_ end of polar 0 (* 60 txsz) ) ;_ end of polar (* 1.5 pi) (* 3 txsz) ) ;_ end of polar ) ;setq ) ;progn ) ;if (command) (setq colr "2") (c:mklayr) (command ".text" "c" tp1 txsz 0 cnt ".text" "c" tp2 txsz 0 cang ".text" "c" tp3 txsz 0 radl ".text" "c" tp4 txsz 0 tanl ".text" "c" tp6 txsz 0 arcl ".circle" tp5 txsz ".line" lp3 lp4 "" ) ;_ end of command ;command (setq cidno (getpoint "\nPlace curve I.D. no. ") idcir (polar cidno (/ pi 2) (/ txsz 2)) ) ;setq (command) (command ".text" "c" cidno txsz 0 cnt ".circle" idcir txsz) ;_ end of command ;command ) ;progn ) ;if ) ;while (setq bp5 (polar lp4 pi (* 12 txsz)) bp3 (polar bp5 pi (* 12 txsz)) bp2 (polar bp3 pi (* 12 txsz)) bp1 (polar bp2 pi (* 12 txsz)) ) ;setq (command) (setq colr "4") (c:mklayr) (command ".pline" lp0 vp4 lp4 lp3 "c" ".line" vp1 bp1 "" ".line" vp2 bp2 "" ".line" vp3 bp3 "" ".line" vp5 bp5 "" ) ;_ end of command ;command (getstyle "") (setvar "cmdecho" 1) (command) ) ;defun ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 0 0 0 T T nil T) ;*** DO NOT add text below the comment! ***|;