; ; This program will place a leader with a vertical line for multiline ; notes in the drawing. the leader may be single or multiple lines ; at any angle. A vertical line will be placed at the end of the last ; leader line if you input points for its Y values. After the vertical ; line is placed the notes and line are repositioned so that the vertical ; line is centered on the end of the last leader line. ; ; AUTHOR: HENRY C. FRANCIS ; 425 N. ASHE ST. ; SOUTHERN PINES, NC 28387 ; ; All rights reserved without prejudice. ; Copyright: 4-14-94 ; Edited: 5-26-94 ; (DEFUN C:MLT ( / pt1 mp2 numb mpb mpn bldsc clayr txht ntxt nxtx nxxt ntx1 ntx2 ntx3 ntx4 ntx5 ntx6 ntx7 ntx8 ntx9 ntx10) (setvar "cmdecho" 0) (setq vwtwst(getvar "viewtwist")) (SETQ old_ucsfollow (GETVAR "ucsfollow")) (SETVAR "ucsfollow" 0) (if (tblsearch "ucs" "pre-mlt") (progn (command "ucs" "s" "pre-mlt" "y") (command "ucs" "w") );progn (progn (command ".ucs" "s" "pre-mlt") (command "ucs" "w") );progn );if ; (if(= vwtwst 0)nil ; (command ".ucs" "3p" (getvar "viewctr") (strcat"@100<"(angtos(- 0 vwtwst)0 4))(strcat"@200<"(angtos(+(- 0 vwtwst)(/ pi 2))0 4))) ; );if (setq osmod (getvar"osmode")) (setvar "osmode" 0) (setq clayr (getvar"clayer") txht (getvar"textsize") dimsc (getvar"dimscale") numb 0 );setq (txtsize nil) (getstyle "A") (setq colr lncolr) (c:mklayr) (command) (if (or(=(substr clayr 7 5)"7NOTE")(and mjrg prod)) (while (setq pt1 (getpoint "\nStart point of leader ")) (setq mp1 pt1) (while (setq mp2 (upoint 0 "" "Next point " nil mp1)) (progn (setq topl nil botl nil toppt nil botpt nil) (command ".line" mp1 mp2 "") (setq mpn mp1 mp1 mp2 llan (angle mpn mp1) );setq (if (and (> llan (* pi 0.5)) (< llan (* pi 1.5)) );and (setq tjst "mr" tang (- pi vwtwst) ;tang pi );setq (setq tjst "ml" tang (- 0 vwtwst) );setq );if (setq tan2 (-(* pi 1.5)vwtwst) ;(* pi 1.5) mp3 (polar mp1 tang dis3) mp3 (list(car mp3)(cadr mp3)(* dimsc 1002)) 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) );setq (if (= numb 0) (progn (setq mpl mp2 numb 1 );setq );progn );if );progn );while (setq ang1 (+ (angle pt1 mpl)(-(* 0.055555 pi)vwtwst) ;(+ (angle pt1 mpl)(* 0.055555 pi)) ang2 (- (angle pt1 mpl)(-(* 0.055555 pi)vwtwst) spt2 (polar pt1 ang1 dis1) spt3 (polar pt1 ang2 dis1) inss1 (*(/ txtht (* dimsc 0.125))dimsc) );setq (command ".insert" "ldraro" pt1 inss1 inss1 mpl) (if (not (eq "" (setq ntx1 (ustr 0 "\nNote Text ? " "" "T"))) );not (if (not (eq "" (setq ntx2 (ustr 0 "\nSecond Text Line ? " "" "T"))) );not (if (not (eq "" (setq ntx3 (ustr 0 "\nThird Text Line ? " "" "T"))) );not (if (not (eq "" (setq ntx4 (ustr 0 "\nFourth Text Line ? " "" "T"))) );not (if (not (eq "" (setq ntx5 (ustr 0 "\nFifth Text Line ? " "" "T"))) );not (if (not (eq "" (setq ntx6 (ustr 0 "\nSixth Text Line ? " "" "T"))) );not (if (not (eq "" (setq ntx7 (ustr 0 "\nSeventh Text Line ? " "" "T"))) );not (if (not (eq "" (setq ntx8 (ustr 0 "\nEighth Text Line ? " "" "T"))) );not (if (not (eq "" (setq ntx9 (ustr 0 "\nNinth Text Line ? " "" "T"))) );not (setq ntx10 (ustr 0 "\nTenth Text Line ? " "" "T")) );if );if );if );if );if );if );if );if );if (setq colr txcolr) (c:mklayr) (command ".text" "j" tjst mp3 dis1 0 ntx1) (setq ent1 (entlast) ss (ssadd) etest (entlast) etins (trans(cdr(assoc 10 (entget(entlast))))0 1) topl (polar(trans(cdr(assoc 10 (entget ent1)))0 1)(* pi 0.5)dis1) );setq (ssadd ent1 ss) (command ".text" "j" tjst mp4 dis1 0 ntx2) (setq ent1 (entlast)) (if(<(car(trans(cdr(assoc 10(entget(entlast))))0 1))(car etins)) (setq etins (trans(cdr(assoc 10(entget(entlast))))0 1)) );if (ssadd ent1 ss) (command ".text" "j" tjst mp5 dis1 0 ntx3) (setq ent1 (entlast)) (if(<(car(trans(cdr(assoc 10(entget(entlast))))0 1))(car etins)) (setq etins (trans(cdr(assoc 10(entget(entlast))))0 1)) );if (ssadd ent1 ss) (command ".text" "j" tjst mp6 dis1 0 ntx4) (setq ent1 (entlast)) (if(<(car(trans(cdr(assoc 10(entget(entlast))))0 1))(car etins)) (setq etins (trans(cdr(assoc 10(entget(entlast))))0 1)) );if (ssadd ent1 ss) (command ".text" "j" tjst mp7 dis1 0 ntx5) (setq ent1 (entlast)) (if(<(car(trans(cdr(assoc 10(entget(entlast))))0 1))(car etins)) (setq etins (trans(cdr(assoc 10(entget(entlast))))0 1)) );if (ssadd ent1 ss) (command ".text" "j" tjst mp8 dis1 0 ntx6) (setq ent1 (entlast)) (if(<(car(trans(cdr(assoc 10(entget(entlast))))0 1))(car etins)) (setq etins (trans(cdr(assoc 10(entget(entlast))))0 1)) );if (ssadd ent1 ss) (command ".text" "j" tjst mp9 dis1 0 ntx7) (setq ent1 (entlast)) (if(<(car(trans(cdr(assoc 10(entget(entlast))))0 1))(car etins)) (setq etins (trans(cdr(assoc 10(entget(entlast))))0 1)) );if (ssadd ent1 ss) (command ".text" "j" tjst mp10 dis1 0 ntx8) (setq ent1 (entlast)) (if(<(car(trans(cdr(assoc 10(entget(entlast))))0 1))(car etins)) (setq etins (trans(cdr(assoc 10(entget(entlast))))0 1)) );if (ssadd ent1 ss) (command ".text" "j" tjst mp11 dis1 0 ntx9) (setq ent1 (entlast)) (if(<(car(trans(cdr(assoc 10(entget(entlast))))0 1))(car etins)) (setq etins (trans(cdr(assoc 10(entget(entlast))))0 1)) );if (ssadd ent1 ss) (command ".text" "j" tjst mp12 dis1 0 ntx10) (setq ent1 (entlast)) (if(<(car(trans(cdr(assoc 10(entget(entlast))))0 1))(car etins)) (setq etins (trans(cdr(assoc 10(entget(entlast))))0 1)) );if (ssadd ent1 ss) (setq colr lncolr) (c:mklayr) (command) (if (eq ntx2 "") nil (progn (setq botl (polar topl (* pi 1.5) (-(* dis2 (sslength ss))(* dis1 0.625)))) ;(upoint 1 "" "\nBottom of Note ? " mp1 mp1) );progn );if (if (and topl botl) (progn (setq toppt (list (car mp1) (cadr topl))) (setq botpt (list (car mp1) (cadr botl))) (command ".line" toppt botpt "") (setq ent1 (entlast)) (ssadd ent1 ss) (setq vpt (polar toppt (* 1.5 pi) (/ (distance toppt botpt) 2.0))) (command ".move" ss "" vpt mp1) );progn );if (setq tj72 0 tj73 0 tj10 (trans etins 1 0) tj11 (list 0.0 0.0 (* dimsc 1002)) cntr 0 tsln (sslength ss) );setq (while (if (and (< cntr tsln) ss) (setq tent (entget (ssname ss cntr))) );if (progn (setq edtw (entget (cdar tent))) (if (eq(cdr(assoc 0 edtw))"TEXT") (progn (setq tranx (car(trans etins 1 0)) trany (caddr(assoc 10 edtw)) tranz (* dimsc 1002) tj10x (car(trans(list tranx trany tranz)0 1)) ent72 (cdr (assoc 72 edtw)) ent73 (cdr (assoc 73 edtw)) ; tj10x (car etins) ent0y (cadr(trans(cdr(assoc 10 edtw))0 1)) ent0z (* dimsc 1002) ;cadddr(assoc 10 edtw)) tj11x (car tj11) tj11y (cadr tj11) tj11z (caddr tj11) ent1x (car(trans(cdr(assoc 11 edtw))0 1)) ent1y (cadr(trans(cdr(assoc 11 edtw))0 1)) ent1z (* dimsc 1002) ;(cadddr(assoc 11 edtw)) );setq (setq edtw (subst (cons 72 tj72) (assoc 72 edtw) edtw ) );setq (setq edtw (subst (cons 73 tj73) (assoc 73 edtw) edtw ) );setq (setq edtw (subst (list 11 0.0 0.0 (* dimsc 1002)) (assoc 11 edtw) edtw ) );setq (setq edtw (subst (list 10 tj10x ent0y ent0z) (assoc 10 edtw) edtw ) );setq (entmod edtw) );progn );if );progn (setq cntr (1+ cntr)) );while (setq numb 0) (setq ntx1 nil ntx2 nil ntx3 nil ntx4 nil ntx5 nil ntx6 nil ntx7 nil ntx8 nil ntx9 nil ntx10 nil) );while );if (setvar "clayer" clayr) (setvar "textsize" txht) (getstyle "") (setvar "osmode" osmod) (setvar "cmdecho" 1) (command ".ucs" "r" "pre-mlt") (SETVAR "ucsfollow" old_ucsfollow) );defun