;;;Place a detail title bubble with title text, underline and scale text. ;;; Uses DIMSCALE and LUNITS to format scale string and scale bubble ;;; and text. ;;; ;;; ;;; ;;; ;;; Requirements: GETSTYLE.LSP (gets current style values and changes ;;; them as req'd for this function only.) ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 9-30-93 ;;;> EDITED: 06-29-2006 ;;; (DEFUN c:dttl (/ attdlg pt1 mpb mpe clayr dimsc txht ttlsz sclsz dscl ip0 ip1 ip2 llen layt2 layt6) (SETVAR "cmdecho" 0) (IF dimscl nil (LOAD "dimscl" "\nFile DIMSCL.LSP not loaded! ") ) ;_ end of if (dimscl) (IF ukword nil (LOAD "ukword" "\nFile UKWORD.LSP not loaded! ") ) ;_ end of if (IF ustr nil (LOAD "ustr" "\nFile USTR.LSP not loaded! ") ) ;_ end of if (SETQ old_prod prod) (gvpno) (SETQ attdlg (GETVAR "attdia") attrq (GETVAR "attreq") clayr (GETVAR "clayer") ntz 0 ;(* 1001 dimsc) txht (GETVAR "textsize") pt1 (GETPOINT "\nDetail Title Midpoint ") ptz (LIST (CAR pt1) (CADR pt1) ntz) pt1 (POLAR ptz (- 0 (GETVAR "viewtwist")) (* dimsc 0.875)) mpb (POLAR pt1 (+ (- 0 (GETVAR "viewtwist")) PI) (* dimsc 0.375)) dtttl (STRCASE (ukword 1 "Title Section Detail Elevation" "\nTitle, Section, Detail or Elevation " (COND ((AND dttl (WCMATCH dtttl "* *")) "TITLE") (dtttl dtttl) (T "DETAIL") ) ;_ end of cond ) ;_ end of ukword ) ;_ end of strcase ttlsz (* dimsc 0.1 1.75) ;Title height (175 template) dscsz (* dimsc 0.1 1.40) ;Description height (140 template) llen (* (STRLEN dtttl) ttlsz) ;(+(/ (strlen dtttl) 12.0)2.0) sclsz (* dimsc 0.110) ;dimscale * 87.5 template sctyp (ukword 1 "Not To" "\nN.T.S. or To scale? (Not or To) " (IF sctyp sctyp "T" ) ;_ end of if ) ;_ end of ukword mjrg (IF mjrg mjrg "G" ) ;_ end of if prod (IF prod prod (COND ((EQ dtttl "Section") "SECT") ((EQ dtttl "Detail") "DETL") ((EQ dtttl "Elevation") "ELEV") ((EQ dtttl "Title") "TITL") ) ;_ end of cond ) ;_ end of if colr "1" modf "SYMB" e1ang (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) ) ;setq (IF (EQ dtttl "DETAIL") (SETQ dsctl (STRCASE (ustr 1 "Descriptive Detail Title" (IF dsctl dsctl "PUT DESCRIPTIVE TITLE HERE" ) ;_ end of if T ) ;_ end of ustr ) ;_ end of strcase ) ;_ end of SETQ ) ;_ end of IF (IF (EQ dtttl "TITLE") (SETQ dtttl (STRCASE (ustr 1 "Descriptive Title" (IF dsctl dsctl "PUT DESCRIPTIVE TITLE HERE" ) ;_ end of if T ) ;_ end of ustr ) ;_ end of strcase ) ;_ end of SETQ ) ;_ end of IF (SETVAR "attreq" 0) (IF getstyle (getstyle "A") (PROGN (LOAD "getstyle") (getstyle "A")) ) ;_ end of if (IF c:mklayr nil (LOAD "mklayr" "\nFile MKLAYR.LSP not loaded! ") ) ;_ end of IF (c:mklayr) (IF (OR (= (SUBSTR clayr 2 9) "SECT1SYMB") mjrg) (PROGN (IF (= (SUBSTR sctyp 1 1) "T") (IF (OR (= (GETVAR "lunits") 4) (= (GETVAR "lunits") 3)) (SETQ dscl (STRCAT (RTOS (/ 1.0 (/ dimsc 12.0)) 4 6) " = 1'-0\"")) (SETQ dscl (STRCAT "1\" = " (RTOS dimsc 2 0) "'")) ) ;if (SETQ dscl "NOT TO SCALE") ) ;if (SETQ ip0 (POLAR mpb (+ (- 0 (GETVAR "viewtwist")) PI) (* dimsc 1.75)) ;(polar mpb e1ang (* dimsc 0.2)) ip1 (POLAR ip0 (+ e1ang (* 1.50 PI)) (* dimsc 0.2)) ;was (* sclsz 1.75) ip2 (POLAR ip0 (+ e1ang (* 0.50 PI)) (* dimsc 0.11)) ;was (* ttlsz 0.625) ip3 (POLAR (POLAR mpb (+ PI (- 0 (GETVAR "viewtwist"))) (* dimsc 0.5)) (+ (/ PI 2.0) (- 0 (GETVAR "viewtwist"))) (* dimsc 0.6875) ) ;_ end of polar sclln (* (STRLEN dscl) sclsz) ) ;setq (SETVAR "attdia" 0) (SETVAR "cecolor" "bylayer") (SETQ colr "6" modf "TEXT" ) ;_ end of setq (c:mklayr) (ENTMAKE (LIST (CONS 0 "TEXT") (CONS 10 ip1) (CONS 40 sclsz) (CONS 50 (- 0 (GETVAR "viewtwist"))) (CONS 1 dscl) ) ;_ end of list ) ;entmake (SETQ txten1 (ENTGET (ENTLAST)) txtbx1 (TEXTBOX txten1) txtln1 (ABS (- (CAR (NTH 1 txtbx1)) (CAR (NTH 0 txtbx1)))) colr "2" ) ;_ end of setq (c:mklayr) (ENTMAKE (LIST (CONS 0 "TEXT") (CONS 10 ip2) (CONS 40 ttlsz) (CONS 50 (- 0 (GETVAR "viewtwist"))) (CONS 1 dtttl) ) ;_ end of list ) ;entmake (SETQ txten2 (ENTGET (ENTLAST)) txtbx2 (TEXTBOX txten2) txtln2 (ABS (- (CAR (NTH 1 txtbx2)) (CAR (NTH 0 txtbx2)))) txtln (* dimsc 1.75) ;(+ ttlsz(max txtln1 txtln2)) mpe (POLAR mpb (+ (- 0 (GETVAR "viewtwist")) PI) txtln) ) ;setq (IF (EQ dtttl "DETAIL") (PROGN (SETQ colr "4") (c:mklayr) (ENTMAKE (LIST (CONS 0 "TEXT") (CONS 10 ip3) (CONS 11 ip3) (CONS 40 dscsz) (CONS 50 (- 0 (GETVAR "viewtwist"))) (CONS 72 4) (CONS 73 2) (CONS 1 dsctl) ) ;_ end of list ) ;entmake ) ;_ end of PROGN ) ;_ end of IF (SETQ modf "SYMB" colr "2" ) ;_ end of SETQ (c:mklayr) (ENTMAKE (LIST (CONS 0 "LINE") (CONS 10 mpb) (CONS 11 mpe))) ;entmake (c:mklayr) (COMMAND ".insert" "b" pt1 dimsc dimsc e1ang) (COMMAND ".ddatte" "l") (SETVAR "clayer" clayr) (SETVAR "attdia" attdlg) (SETVAR "attreq" attrq) (SETVAR "textsize" txht) (getstyle "") (SETVAR "cmdecho" 1) (COMMAND) ) ;progn ) ;if (SETQ prod old_prod) (PRINC) ) ;DEFUN C:DTTL ;|«Visual LISP© Format Options» (100 2 30 2 T "end of " 100 9 2 1 1 T nil nil T) ;*** DO NOT add text below the comment! ***|;