;;; Draw Arrow with user specified values.
;;; Created by Quest for Peace from here: http://www.cadtutor.net/forum/showthread.php?64876-Lisp-to-draw-an-arrow
;;; Modified by Igal Averbuh 2016 (added option to enter arrowhead width by two points and changed "c" value)

(defun c:ah (/ a b c wid)
(vl-load-com)
(setq
a (getpoint "Pick Head of Arrow...\n")
wid (getdist "Enter Arrowhead width by two points...\n ")
b (getpoint a "Pick Tail of Arrow...\n")
c (polar a (angle a b) (/ (distance a b) 10.0))

; wid (/ (distance a b) 10.0)
)
(vla-setWidth
(vlax-ename->vla-object
(entmakex
(append
(list
(cons 0 "LWPOLYLINE")
(cons 100 "AcDbEntity")
(cons 100 "AcDbPolyline")
(cons 90 3)
)
(mapcar
(function (lambda (p) (cons 10 (trans p 1 0))))
(list a c b)
)
)
)
)
0
0.0
wid
)
(princ)
)
(c:ah)

Advertisements