请看一下下面的AUTOLISP 程序有什么错误(defun c:ap ()(setq pt1 (getpoint "input the center"))(setq r (getdisk " \ninput the r:"))(command "circle" pt1 r)(setq pt2(polar pt1 0 (* r 4)))(command "circle" pt2 r)(setq pt3(polar pt1 (\ pi 3) (

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/01 03:24:33

请看一下下面的AUTOLISP 程序有什么错误(defun c:ap ()(setq pt1 (getpoint "input the center"))(setq r (getdisk " \ninput the r:"))(command "circle" pt1 r)(setq pt2(polar pt1 0 (* r 4)))(command "circle" pt2 r)(setq pt3(polar pt1 (\ pi 3) (
请看一下下面的AUTOLISP 程序有什么错误
(defun c:ap ()
(setq pt1 (getpoint "input the center"))
(setq r (getdisk " \ninput the r:"))
(command "circle" pt1 r)
(setq pt2(polar pt1 0 (* r 4)))
(command "circle" pt2 r)
(setq pt3(polar pt1 (\ pi 3) (* r 2)))
(setq pt4(polar pt1 0 (* r 2)))
(setq pt5(polar pt4 (\ pi 3) (* r 2)))
(setq pt6(polar pt3 (\ pi 3) (* r 2)))
(setq pt7(polar pt6 0 (* r)))(polar pt1 0 (* r 2)))
(command "line" pt4 pt2 "")
(command "line" pt4 pt5 "")\x09
(command "line" pt2 pt5 "")
(command "line" pt1 pt3 "")
(command "line" pt4 pt3 "")
(command "line" pt5 pt3 "")
(command "line" pt5 pt6 "")
(command "line" pt7 pt6 "")
(princ)
)
我想要二次开发一个简单的自行车图形

请看一下下面的AUTOLISP 程序有什么错误(defun c:ap ()(setq pt1 (getpoint "input the center"))(setq r (getdisk " \ninput the r:"))(command "circle" pt1 r)(setq pt2(polar pt1 0 (* r 4)))(command "circle" pt2 r)(setq pt3(polar pt1 (\ pi 3) (

做了一些修改,可以绘制了.仔细看看里面修改内容.除以符号“/”,不是“\”.多了一个刮弧,还有getdisk应当为getdist

(setq pt7 (polar pt6 0 (* r 2)));这个少了2就没有办法乘以.

(defun c:ap ( / pt1 pt2 pt3 pt4 pt5 pt6 pt7 r #os1)
 (setq #os1 (getvar "osmode"));取得捕捉设置
 (setvar "osmode" 0);关闭捕捉绘制图形
  (setq pt1 (getpoint "\n请选择基点"))
  (setq r (getdist "\n请输入半径长度"))
  (command "circle" pt1 r)
  (setq pt2 (polar pt1 0 (* r 4)))
  (command "circle" pt2 r)
  (setq pt3(polar pt1 (/ pi 3) (* r 2)))
  (setq pt4(polar pt1 0 (* r 2)))
  (setq pt5(polar pt4 (/ pi 3) (* r 2)))
  (setq pt6(polar pt3 (/ pi 3) (* r 2)))
  (setq pt7(polar pt6 0 (* r 2)))
  (polar pt1 0 (* r 2))
  (command "line" pt4 pt2 "")
  (command "line" pt4 pt5 "")\x09
  (command "line" pt2 pt5 "")
   (command "line" pt1 pt3 "")
 (command "line" pt4 pt3 "")
  (command "line" pt5 pt3 "")
 (command "line" pt5 pt6 "")
 (command "line" pt7 pt6 "")
 (setvar "osmode" #os1);还原捕捉设置
(prin1)
)