;;; Detail Callout Leader ;;;by TG Christman ;;;Adjust below to match your drawing standards (defun detconfig () ;Replace 7.0 with your text height (setq utxhgt 7.0) ;Replace 070 with your text layer ;requires quotation marks around layer name (setq utxlyr "070") ;Replace "dimension with your leader layer ;requires quotation marks around layer name (setq ldrlyr "dimension") ;Replace 2.5 with your arrow head length (setq ldralgt 2.5) ;Replace 0.84 with your arrow head width (setq ldrawdt 0.84 ) ) (defun leaddet () (setq SC (GETVAR "DIMSCALE")) (setq clo (getvar "clayer")) (setq txthgt (* utxhgt sc)) (setq txto (* sc (/ 35 6))) (setq tsl (strlen detlet)) (setq tll (* tsl (* sc 6.0))) (setq htll (/ tll 2.0)) (setq AL (* ldralgt SC)) (setq AW (* ldrawdt SC)) (setvar "clayer" ldrlyr) (setq pts (getpoint "\nStart point? ")) (setq ptn (getpoint pts "\nNext point? ")) (command ".line" pts ptn "") (command ".pline" pts "w" 0 AW "l" AL "") (setq pt2 pts) (setq pnew ptn) (while (/= pnew nil) (setq pt1 pt2) (setq pt2 pnew) (setq pnew (getpoint pt2 "\nNext point? ")) (if (/= pnew nil)(command ".line" pt2 pnew "")) ) ) (defun C:detlead () (detconfig) (setq detlet (getstring T"\nDetail Letter ? ")) (while (= detlet nil) (princ "\nERROR! Text for detail callout required to continue!") (setq detlet (getstring T"\nDetail Letter ? ")) ) (setq otm (getvar "orthomode")) (SETVAR "orthomode" 0) (setq osm (getvar "osmode")) (SETVAR "osmode" 512) (leaddet) (setq a (car pt1)) (setq b (car pt2)) (setq spx (car pt2)) (setq spy (cadr pt2)) (if (> b a) (progn (setq epx (+ spx tll)) (setq ep (list epx spy)) (setq txtx (+ spx htll)) (setq txty (+ spy txto)) (setq txpnt (list txtx txty)) (command "line" pt2 ep "") (setvar "clayer" utxlyr) (command "text" "mc" txpnt txthgt "" detlet) ) ) (if (> a b) (progn (setq epx (- spx tll)) (setq ep (list epx spy)) (setq txtx (- spx htll)) (setq txty (+ spy txto)) (setq txpnt (list txtx txty)) (command "line" pt2 ep "") (setvar "clayer" utxlyr) (command "text" "mc" txpnt txthgt "" detlet) ) ) (command ".plinewid" 0) (setvar "osmode" osm) (setvar "orthomode" otm) (setvar "clayer" clo) (princ) ) (princ "\n\tDetail Callout Leader loaded.") (princ "\n\tStart command with DETLEAD.") (PRINC)