;;飞诗修订于2010-5-8
(defun C:ArrowHead (/ an dd enda p1 p2 p3 p4 w)
  (setvar "cmdecho" 0)
  (initget "A B C")
  (setq	enda (getkword
	       "\n绘制箭头[直箭头(A)/弯箭头(B)/大弯箭头(C)]<直箭头>:"
	     )
  )
  (or enda (setq enda "A"))
  (while (and (setq p1 (getpoint "\n箭头的尖端位置:"))
	      (setq p2 (getpoint p1 "\n箭头的另一端:"))
	 )
    (setq dd (distance p1 p2))
    (princ (rtos dd 2 4))
    (setq w  (* dd 1.2)
	  an (angle p1 p2)
	  p3 (polar p2 (+ an (* pi 0.5)) (/ w 2.0))
	  p4 (polar p2 (+ an (* pi 1.5)) (/ w 2.0))
    )
    (command ".pline" p1 "w" "0" w p2 "w")
    (cond ((= enda "A")
	   (command (* w 0.4) (* w 0.4))
	   (fstl_sendcmd (strcat "<" (angtos (angle p1 p2) 0 1)))
	   (command (polar p2 an (getdist p2 "\n指定端点：")) "")
	  )
	  ((= enda "B")
	   (command (* w 0.4) (* w 0.4) "a" "\\" "")
	  )
	  ((= enda "C")
	   (command (* w 0.4) w "a" "\\" "")
	  )
    )
  )
  (princ)
)