;;;Place a construction note bubble with a leader in the drawing. ;;;The leader may be single or multiple lines at any angle. ;;;The bubble will be placed with the center along the line and the ;;;edge of the bubble coincident with the end of the leader. ;;;The bubble number may be optionally incremented or held the same ;;;for subsequent placements. ;;; ;;; AUTHOR: ;;; HENRY C. FRANCIS ;;; 425 N. ASHE ST. ;;; SOUTHERN PINES, NC 28387 ;;; ;;; All rights reserved without prejudice. ;;; ;;; Copyright: 9-23-93 ;;; Edited: 6-17-94 ;;; (DEFUN C:CNL (/ pt1 mp1 mp2 numb dimsc mpb mpn bldsc clayr txht rcall skipbt do_tag) (SETQ cmde (GETVAR "cmdecho")) (SETVAR "cmdecho" 0) (SETQ old_attreq (GETVAR "attreq")) (SETVAR "attreq" 1) (SETVAR "cecolor" "bylayer") (TXTSIZE "125") (IF gvpno nil (LOAD "gvpno") ) ;_ end of if (gvpno) (IF dimscl nil (LOAD "dimscl") ) ;_ end of if (dimscl) (IF c:mklayr nil (LOAD "mklayr") ) ;_ end of if (c:svlayr) (SETQ ntz (* 1001 dimsc) numb 0 mjrg (IF mjrg mjrg "C" ) ;_ end of if llt "-" colr "7" modf "NOTE" ) ;_ end of setq (IF mjrg nil (SETQ mjrg "C") ) ;_ end of if (SETQ mpb (LIST "A" "A") did_tag T ref_no (IF old_ref_no old_ref_no 0 ) ;_ end of IF go_around NIL ) ;_ end of SETQ (SETQ use_ldrq (ukword 1 "Yes No" "\nUse leader ? " use_ldrq)) (SETQ arohed (ukword 1 "Yes No" "With arrowhead?" (IF arohed arohed "Yes" ) ;_ end of if ) ;_ end of ukword ) ;_ end of SETQ (SETQ incorhold (ukword 1 "Increment Hold" "ncrement or old reference number for multiple labels?" incorhold ) ;_ end of ukword ) ;_ end of setq (WHILE (NOT(EQ pt1 "Quit")) (IF (EQ arohed "Yes") (IF (NOT (TBLSEARCH "BLOCK" "DIMARO")) (PROGN (ENTMAKE '((0 . "BLOCK") (2 . "DIMARO") (70 . 64) (10 0.0 0.0 0.0)) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 0.0 0.0 0.0) (11 -0.947368 0.157895 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.947368 0.118421 0.0) (11 -0.236842 0.0 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.473684 0.0 0.0) (11 -0.947368 0.0789474 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.947368 0.0394737 0.0) (11 -0.710526 0.0 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.710526 0.0 0.0) (11 -0.947368 -0.0394737 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.947368 -0.0789474 0.0) (11 -0.473684 0.0 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.236842 0.0 0.0) (11 -0.947368 -0.118421 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.947368 -0.157895 0.0) (11 0.0 0.0 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.947368 -0.118421 0.0) (11 -0.947368 -0.0789474 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.947368 -0.0394737 0.0) (11 -0.947368 0.0 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.947368 0.0789474 0.0) (11 -0.947368 0.0394737 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -0.947368 0.118421 0.0) (11 -0.947368 0.157895 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "LINE") (8 . "0") (62 . 0) (10 -1.0 0.0 0.0) (11 -0.947368 0.0 0.0) (210 0.0 0.0 1.0) ) ) ;_ end of entmake (ENTMAKE '((0 . "ENDBLK"))) ) ;_ end of progn ) ;_ end of if ) ;_ end of IF (SETVAR "OSMODE" old_osmodes) (WHILE (AND (SETQ pt1 (upoint 1 "Quit" (STRCAT "\nStart point of " (IF do_exist "Existing" "New" ) ;_ end of IF (IF (AND (EQ colr_over "1") do_tnote) " custom color" "" ) ;_ end of IF " leader or [Quit]" ) ;_ end of STRCAT nil nil ) ;_ end of GETPOINT ) ;_ end of SETQ (NOT(EQ pt1 "Quit"))) (SETQ ldrpt_lst (LIST pt1)) (SETQ mp1 pt1) (SETQ leader_ss (SSADD)) (SETVAR "osmode" 0) (WHILE (SETQ mp2 (upoint 0 "Existing New" (STRCAT "Next " (IF do_exist "Existing" "New" ) ;_ end of IF (IF (AND (EQ colr_over "1") do_tnote) " custom color" "" ) ;_ end of IF " leader point or toggle xisting/ew" ) ;_ end of STRCAT nil mp1 ) ;_ end of upoint ) ;_ end of SETQ (IF (OR (EQ mp2 "Existing") (EQ mp2 "New")) (COND ((EQ mp2 "Existing") (SETQ do_exist T) (IF do_cmud (PROGN (cmud_colr) (SETQ colr txcolr) ) ;_ end of PROGN (SETQ colr "1") ) ;_ end of IF (c:mklayr) ) ((EQ mp2 "New") (SETQ do_exist NIL) (IF do_cmud (PROGN (cmud_colr) (SETQ colr txcolr) ) ;_ end of PROGN (SETQ colr "2") ) ;_ end of IF ) ) ;_ end of COND (PROGN (IF do_cmud (cmud_colr) ) ;_ end of IF (COND ((AND do_tnote (EQ colr_over "1")) (SETQ colr tnote_ldrc) ) ) ;_ end of COND (SETQ topl nil botl nil ) ;_ end of SETQ (COMMAND ".line" mp1 mp2 "") (SETQ leader_ss (SSADD (ENTLAST) leader_ss)) (SETQ ldrpt_lst (APPEND ldrpt_lst (LIST mp2))) (SETQ mpn mp1 mp1 mp2 mpsp (POLAR mp1 tang (* (GETVAR "dimexe") dimsc)) tan2 (- (* PI 1.5) (GETVAR "VIEWTWIST")) mp3 (POLAR mpsp tang dis3) mp3 (LIST (CAR mp3) (CADR mp3) 0) mp4 (POLAR mp3 tan2 dis2) mp5 (POLAR mp4 tan2 dis2) mp6 (POLAR mp5 tan2 dis2) mp7 (POLAR mp6 tan2 dis2) mp8 (POLAR mp7 tan2 dis2) mp9 (POLAR mp8 tan2 dis2) mp10 (POLAR mp9 tan2 dis2) mp11 (POLAR mp10 tan2 dis2) mp12 (POLAR mp11 tan2 dis2) tang_d (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) ) ;_ end of SETQ (IF (= numb 0) (PROGN (SETQ mpl mp2 numb 1 ) ;_ end of SETQ ) ;_ end of PROGN ) ;_ end of IF ) ;_ end of PROGN ) ;_ end of IF ) ;_ end of WHILE (SETQ inss1 dimsc) (IF mjrg nil (SETQ mjrg "G") ) ;_ end of if (IF prod nil (SETQ prod "DETL") ) ;_ end of if (SETQ assoc10_lst nil) (FOREACH n ldrpt_lst (IF assoc10_lst (SETQ assoc10_lst (APPEND assoc10_lst (LIST (CONS 10 n)))) (SETQ assoc10_lst (LIST (CONS 10 n))) ) ;_ end of if ) ;_ end of foreach (IF (AND(<= (DISTANCE (CDR (LAST assoc10_lst))(CDADR (REVERSE assoc10_lst)))(* dimsc 0.1)));(WCMATCH(GETVAR"ACADVER")"14*") (SETQ assoc10_lst (REVERSE (CDR (REVERSE assoc10_lst)))) ) (IF (AND do_tnote (EQ colr_over "1")) (SETQ colr tnote_ldrc) (PROGN (set_txt_colr thts) (SETQ colr lncolr) ) ) (c:mklayr) (IF (TBLSEARCH "DIMSTYLE" "ARCHLEADER") NIL (PROGN (IF c:archldrs NIL (LOAD "archldrs")) (IF c:archldrs (C:ARCHLDRS) ) ) ) (IF (TBLSEARCH "DIMSTYLE" "ARCHLEADER") (SETQ ldrent_lst1 (LIST (CONS 0 "LEADER") (CONS 3 "ARCHLEADER") (CONS 100 "AcDbEntity") (IF (OR (EQ (GETVAR "tilemode") 1) (> (GETVAR "cvport") 1)) (CONS 67 0) (CONS 67 1) ) ;_ end of if (CONS 8 new_ln) (CONS 100 "AcDbLeader") (IF (EQ arohed "Yes") (CONS 71 1) (CONS 71 0) ) ;_ end of if (CONS 72 0) (CONS 73 3) (CONS 75 0) (CONS 76 (LENGTH ldrpt_lst)) ) ;_ end of list ) ;_ end of setq (SETQ ldrent_lst1 (LIST (CONS 0 "LEADER") (CONS 100 "AcDbEntity") (IF (OR (EQ (GETVAR "tilemode") 1) (> (GETVAR "cvport") 1)) (CONS 67 0) (CONS 67 1) ) ;_ end of if (CONS 8 new_ln) (CONS 100 "AcDbLeader") (CONS 3 "STANDARD") (IF (EQ arohed "Yes") (CONS 71 1) (CONS 71 0) ) ;_ end of if (CONS 72 0) (CONS 73 3) (CONS 75 0) (CONS 76 (LENGTH ldrpt_lst)) ) ;_ end of list ) ;_ end of setq ) (SETQ ldrent_lst2 (LIST (CONS 77 ;;; (IF do_cmud ;;; (ATOI txcolr) (ATOI lncolr) ;;; ) ;_ end of IF ) ;_ end of CONS (CONS 210 (LIST 0.0 0.0 1.0)) (IF (EQ tjst "mr") (CONS 211 (LIST (COS (+ tang PI)) (SIN (+ tang PI)) 0.0)) (CONS 211 (LIST (COS tang) (SIN tang) 0.0)) ) ;_ end of if (CONS 212 (LIST 0.0 0.0 0.0)) (CONS 213 (LIST 0.0 0.0 0.0)) ) ;_ end of list ) ;_ end of setq (SETQ ldrent_lst (APPEND ldrent_lst1 assoc10_lst ldrent_lst2)) (COMMAND ".ERASE" leader_ss "") (ENTMAKE ldrent_lst) (IF (EQ use_ldrq "Yes") (IF (>(Length assoc10_lst)1) (SETQ mpb (POLAR (CDR (LAST assoc10_lst)) (ANGLE (CDADR (REVERSE assoc10_lst)) (CDR (LAST assoc10_lst)) ) ;_ end of ANGLE (* dimsc 0.14428571) ) ;_ end of POLAR ) ;_ end of SETQ (SETQ mpb NIL) ) ;;; (SETQ ;;; mpb (upoint 1 "Quit" "Tag insertion point or [Quit]" nil (IF(AND mpb(EQ(TYPE mpb)'LIST)(NOT(EQUAL mpb (LIST "A" "A"))))mpb)) ;;; do_tag T ;;; ) ;_ end of SETQ ) ;_ end of IF (IF (AND (/= mpb "Quit") mpb) (PROGN (SETQ dscsz (* dimsc 0.125)) (SETQ colr "6") (c:mklayr) (IF (AND ref_no (/= ref_no "Quit")) (SETQ old_ref_no ref_no) (SETQ old_ref_no 0) ) ;_ end of IF (SETQ ref_no (uint 1 "" "Reference Number" (IF ref_no (IF (EQ incorhold "Hold") ref_no (1+ ref_no) ) ;_ end of if 1 ) ;_ end of if ) ;_ end of uint ) ;_ end of setq ;;; (COMMAND ".ERASE" leader_ss "") (IF (/= ref_no "Quit") (PROGN (IF (AND ldrent_lst (EQ use_ldrq "Yes")) (PROGN (ENTMAKE ldrent_lst) (SETQ ldrent_lst NIL) ) ;_ end of PROGN ) ;_ end of IF (COMMAND ".insert" "b_tag" mpb dimsc dimsc (* (/ (- 0 (GETVAR "viewtwist")) PI) 180) ref_no ) ;_ end of command (SETQ did_tag T) ) ;_ end of PROGN ) ;_ end of IF (SETQ numb 0 do_tag nil ) ;_ end of SETQ ) ;_ end of PROGN ) ;_ end of IF ) ;_ end of PROGN (IF (AND (EQ (LENGTH assoc10_lst) 1) (NOT mpb) (EQ use_ldrq "Yes")) (PRINC "\nProvide at least two points when using leaders!") ) ) ;_ end of WHILE (c:rslayr) (SETVAR "cmdecho" cmde) (SETVAR "attreq" old_attreq) (PRINC) ) ;_ end of DEFUN ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 2 0 0 T T nil T) ***Don't add text below the comment!***|;