满意答案
hhmeme
2013.12.15
采纳率:51% 等级:12
已帮助:9370人
(defun c:zfx(/ A ANG p1 p2 p3 p4 p5 os cmd)
(SETQ CMD (GETVAR "cmdecho"))
(SETVAR "cmdecho" 0)
(setq os (getvar "osmode"))
(setq A (getreal"\n:输入边长"))
(setq ANG (getreal"\n:输入角度"))
(setq p1 (getpoint"\n:指定起点"))
(setvar "osmode" 0)
(setq p2 (polar p1 (* pi (/ ANG 180)) A))
(setq p3 (polar p2 (* pi (+ 0.5 (/ ANG 180))) A))
(setq p4 (polar p1 (* pi (+ 0.5 (/ ANG 180))) A))
(command "pline" p1 p2 p3 p4 "c")
(SETQ p5 (polar p1 (+ (* pi (/ ANG 180)) (* 0.25 pi)) (* A (sin (/ pi 4)))))
(command "circle" p5 (* 0.5 A))
(setvar "osmode" os)
(SETVAR "cmdecho" CMD)
(PRINC)
)
00分享举报