(defun c:5j() ;*将快捷键设为5j*;
(setq os (getvar "osmode")) ;提取当前捕捉的总值;
(setvar "osmode" 0) ;关掉捕捉;
(setq int (getpoint"\n please get a point:")) ;给定五角星的中心点;
(setq value (getdist "\n please get a value:")) ;输入五角星的半径值;
(get_pt) ;调用子程序;
(command"pline" p1 p2 p3 p4 p5 "c") ;利用pline命令将五角星画出来;
(setvar "osmode" os) ;开捕捉;
(prin1)
)
;子程序用来计算五角星的五个点的坐标;
(defun get_pt()
(setq p1 (polar int (* pi 0.5) value))
(setq p2 (polar int (- (* pi 1.5) (* pi 0.2)) value))
(setq p3 (polar int (* pi 0.1) value))
(setq p4 (polar int (- pi (* pi 0.1)) value))
(setq p5 (polar int (+ (* pi 1.5) (* pi 0.2)) value))
)