;TIPXXXX.LSP: SW.LSP Straight Arrow Leader (c) 1997, Yuqun Lian ;;; This routine draws a straight leader constructed with a polyline on ;;; the current layer. The standard dimension arrow is used. You can ;;; adjust its size by changing the value of DIMSCALE or DIMASZ. ;;; Yuqun Lian - SimpleCAD, http://www.simplecad.com 3/19/97 ;;; ------------------------------------------------------------------------ (defun C:SW (/ tempcmd templt tempplw temportho tempblip aleng awidth pt1 pt2 ent1 ang pt3 pt4 ) (setq tempcmd (getvar "cmdecho")) (setq templt (getvar "celtype")) (setq tempplw (getvar "plinewid")) (setq temportho (getvar "orthomode")) (setq tempblip (getvar "blipmode")) (setvar "cmdecho" 0) (setvar "celtype" "bylayer") (setvar "orthomode" 0) (setvar "blipmode" 0) ; set arrow size (setq aleng (* (getvar "dimasz") (getvar "dimscale"))) (setq awidth (/ aleng 3.)) (if (setq pt1 (getpoint "\nLeader start:")) (progn (initget 1) (setq pt2 (getpoint pt1 "\nTo point: ")) (command "line" pt1 pt2 "") (setq ent1 (entlast)) (setq ang (angle pt1 pt2)) (setvar "orthomode" 1 ) (setq pt3 (getpoint pt2 "\nTo point:")) (if (null pt3) (setq pt3 pt2) ) (setq pt4 (polar pt1 ang aleng)) (entdel ent1) (setvar "fillmode" 1) (command "pline" pt3 "w" "0" "0" pt2 pt1 "W" "0" awidth pt4 "w" "0" "0" "") ) ;progn ) if pt1 (setvar "orthomode" temportho) (setvar "celtype" templt) (setvar "plinewid" tempplw) (setvar "blipmode" tempblip) (setvar "cmdecho" tempcmd) (princ) ) ;end sw (prompt "\nType SW to draw straight arrow leader") (princ)