用autolisp画一个太极图样 编出来的程序总是加载不出来 求大神指点
(defunzwc()(setqa1(getpoint":指定大圆圆心")(setqcp1(getlist":指定大圆半径")(setqcp2(getlist"小圆半径:...
(defun zwc()
(setq a1 (getpoint ":指定大圆圆心")
(setq cp1 (getlist ":指定大圆半径")
(setq cp2 (getlist "小圆半径:")
(setq p1 (polar a1 (/pi 2) cp1))
(setq p3 (polar a1 (/pi 2) (/cp1 2))
(setq p2 (polar p2 pi (/cp1 4))
(setq p6 (polar a1 (/p1 -2) (/cp1 2))
(setq p5 (polar a1 (/p1 -2) cp1))
(setq p4 (polar p6 0 (/cp1 4))
(command "circle" a1 cp1)
(command "circle" p3 cp2)
(command "circle" p6 cp2)
(command "arc" p1 p2 a1)
(command "arc" a1 p4 p5)
) 展开
(setq a1 (getpoint ":指定大圆圆心")
(setq cp1 (getlist ":指定大圆半径")
(setq cp2 (getlist "小圆半径:")
(setq p1 (polar a1 (/pi 2) cp1))
(setq p3 (polar a1 (/pi 2) (/cp1 2))
(setq p2 (polar p2 pi (/cp1 4))
(setq p6 (polar a1 (/p1 -2) (/cp1 2))
(setq p5 (polar a1 (/p1 -2) cp1))
(setq p4 (polar p6 0 (/cp1 4))
(command "circle" a1 cp1)
(command "circle" p3 cp2)
(command "circle" p6 cp2)
(command "arc" p1 p2 a1)
(command "arc" a1 p4 p5)
) 展开
1个回答
推荐于2016-06-07 · 知道合伙人软件行家
关注
展开全部
(defun C:tes ( / #os1 a1 cp1 cp2 p1 p2 p3 p4 p5 p6)
(setvar "cmdecho" 0)
(setvar "blipmode" 0)
(setq #os1 (getvar "osmode"))
(setq a1 (getpoint "\n指定大圆圆心"))
(setq cp1 (getdist a1 "\n指定大圆半径"))
(setq cp2 (getdist a1 "\n小圆半径"))
(setq p1 (polar a1 (/ pi 2) cp1))
(setq p2 (polar a1 (/ pi 2) (/ cp1 2)))
(setq p3 (polar p2 pi (/ cp1 4)))
(setq p6 (polar a1 (/ pi -2) (/ cp1 2)))
(setq p5 (polar a1 (/ pi -2) cp1))
(setq p4 (polar p6 0 (/ cp1 4)))
(setvar "osmode" 0)
(command "circle" a1 cp1)
(command "circle" p2 cp2)
(command "circle" p6 cp2)
(command "arc" p1 p3 a1)
(command "arc" a1 p4 p5)
(setvar "osmode" #os1)
(prin1)
);复制到记事本,以【.lsp】为后缀命名。autoLISP加载后,命令为:TES
首先getlist不对,应当getdist
(/pi格式不对,中间少了一个空,应当:(/ pi
(setq p2 (polar p2 pi (/cp1 4));里面的p2没有给定,所以错误
(setq p6 (polar a1 (/p1 -2) (/cp1 2)) ;里面的(/p1 2)不对,角度弧应当(/ pi 2);90°
刮弧数量不对应如(setq cp2 (getlist "小圆半径:");少了一个")"这样的情况很多
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询