1078815748 发表于 2011-7-23 19:48:21

Gu_xl 发表于 2011-7-23 20:38:54

回复 1078815748 的帖子

稍微改了一下:

(defun C:jt(/ oldmode enda p1 p2 dd w)
(prompt "\n绘制箭头")
(setvar "cmdecho" 0)
(setq oldmode (getvar "osmode"))
(setvar "osmode" 0);关闭扑捉

(initget "A B C")
(setq enda (getkword "\n[直箭头A/弯箭头B/大弯箭头<C>] <A>")
      enda (if enda enda "A"))
         
(while (setq p1 (getpoint "\n箭头的尖端位置:"))
      (setq p2 (getpoint p1 "\n箭头的另一端:")
            dd (distance p1 p2))
(prompt (rtos dd 2 4))
(setq w (* dd 1.2)
      an (angle p1 p2)
        )

(if (= enda "A")
(progn
(command "pline" p1 "w" 0 w p2 "w" (* w 0.4) (* w 0.4) (polar p2 an (getdist p2)) "")
   )
   )
   (if (= enda "B")
   (command "pline" p1 "w" "0" w p2 "w" (* w 0.4) (* w 0.4) "a" pause "")
   )
   (if (= enda "C")
   (command "pline" p1 "w" "0" w p2 "w" (* w 0.4) (* w 1.2) "a" pause "")
    )
    (if (= p1 nil) (exit))
    )
(setvar "osmode" oldmode)
(prin1)
)
页: [1]
查看完整版本: 一个命令