早教吧作业答案频道 -->英语-->
autolisp改错(defungeer(x0y0)(setqm(getreal"\npleaseinputm:")z(getint"\npleaseinputz:")b(getreal"\npleaseinputb:")d(getreal"\npleaseinputd:"))(setqd2(*mz))(setqd1(+d2m)d3(-d2m))(setqd22(/d22.0)d11(/d1
题目详情
autolisp改错
(defun geer(x0 y0)
(setq m (getreal "\n please input m:" )
z (getint "\n please input z:" )
b (getreal "\n please input b:" )
d (getreal "\n please input d:" )
)
(setq d2 ( * m z))
(setq d1 ( + d2 m) d3( - d2 m))
(setq d22 (/ d2 2.0) d11 (/ d1 2.0) d33 (/ d3 2.0) d00 (/ d 2.0))
(command "limits" (list 0 0) (list (+ x0 b 50) (+ y0 d11 50))
(command "zoom" "a")
(command "layer" "s" "3" " ")
(command "line"(list (- x0 10) y0) (list (+ x0 b 10) y0))
(command "layer" "s" "0" " ")
(command "line"(list x0 (+ y0 d00 8)) (list x0 (+ y0 d22)) (list (+ x0 b) (+ y0 d22))
(list (+ x0 b) (+ y0 d00 8)) "c")
(command "line"(list x0 (- y0 d00 2)) (list x0 (- y0 d22)) (list (+ x0 b) (- y0 d22))
(list (+ x0 b) (- y0 d00 2)) "c")
(command "layer" "s" "1" " ")
(command "hatch" "u" "45" "4" "n" "w"(list(- x0 2) (- y0 d22 2)) (list(+ x0 b 2) (+ y0 d22 2)) " ")
(command "layer" "s" "0" " ")
(command "line"(list x0 (+ y0 d00 8)) (list x0 (- y0 d00 2)))
(command "line"(list (+ x0 b) (+ y0 d00 8)) (list (+ x0 b) (- y0 d00 2)))
(command "line"(list x0 (+ y0 d00 2)) (list (+ x0 2) (+ y0 d00)) (list (- (+ x0 b) 2) (+ y0 d00))
(list (+ x0 b) (+ y0 d00 2)) )
(command "line"(list x0 (- y0 d00 2)) (list (+ x0 2) (- y0 d00)) (list (- (+ x0 b) 2) (- y0 d00)) (list (+ x0 b) (- y0 d00 2)) )
(command "line"(list (+ x0 2) (- y0 d00)) (list (+ x0 2) (+ y0 d00)) )
(command "line"(list (- (+ x0 b) 2) (- y0 d00)) (list (- (+ x0 b) 2) (+ y0 d00)) )
(command "line"(list x0 (+ y0 d22)) (list (+ x0 m) (+ y0 d11)) (list (- (+ x0 b) m) (+ y0 d11)) (list (+ x0 b) (+ y0 d22)) )
(command "line"(list x0 (- y0 d22)) (list (+ x0 m) (- y0 d11)) (list (- (+ x0 b) m) (- y0 d11)) (list (+ x0 b) (- y0 d22)) )
(command "layer" "s" "2" " ")
(setq a d)
(setq a1 d1)
(setq a2 d2)
(setq a3 (+ d 8))
(setq a4 b)
(setq d (itoa d) d1 (itoa d1) d2 (itoa d2) b (itoa b) c (itoa (+ d 8)))
(setq d (strcat "%%c" d) d1 (strcat "%%c" d1) d2 (strcat "%%c" d2) c (strcat "%%c" c))
(command "dim")
(command "dimtxt" "8")
(command "hor"(list x0 y0) (list (+ x0 b) y0) (list x0 (- y0 d11 14)) b)
(command "ver"(list x0 (- y0 d00)) (list x0 (+ y0 d00)) (list (+ x0 (/ a4 2.0)) y0) d)
(command "ver"(list x0 (- y0 d11)) (list x0 (+ y0 d11)) (list (+ x0 a4 30) y0) d1)
(command "ver"(list x0 (- y0 d22)) (list x0 (+ y0 d22)) (list (+ x0 a4 20) y0) d2)
(command "ver"(list x0 (- y0 d00)) (list x0 (+ y0 d00 8)) (list (+ x0 a4 10) y0) c)
(command "exit")
)
运行时总说“; 错误:输入的列表有缺陷”
(defun geer(x0 y0)
(setq m (getreal "\n please input m:" )
z (getint "\n please input z:" )
b (getreal "\n please input b:" )
d (getreal "\n please input d:" )
)
(setq d2 ( * m z))
(setq d1 ( + d2 m) d3( - d2 m))
(setq d22 (/ d2 2.0) d11 (/ d1 2.0) d33 (/ d3 2.0) d00 (/ d 2.0))
(command "limits" (list 0 0) (list (+ x0 b 50) (+ y0 d11 50))
(command "zoom" "a")
(command "layer" "s" "3" " ")
(command "line"(list (- x0 10) y0) (list (+ x0 b 10) y0))
(command "layer" "s" "0" " ")
(command "line"(list x0 (+ y0 d00 8)) (list x0 (+ y0 d22)) (list (+ x0 b) (+ y0 d22))
(list (+ x0 b) (+ y0 d00 8)) "c")
(command "line"(list x0 (- y0 d00 2)) (list x0 (- y0 d22)) (list (+ x0 b) (- y0 d22))
(list (+ x0 b) (- y0 d00 2)) "c")
(command "layer" "s" "1" " ")
(command "hatch" "u" "45" "4" "n" "w"(list(- x0 2) (- y0 d22 2)) (list(+ x0 b 2) (+ y0 d22 2)) " ")
(command "layer" "s" "0" " ")
(command "line"(list x0 (+ y0 d00 8)) (list x0 (- y0 d00 2)))
(command "line"(list (+ x0 b) (+ y0 d00 8)) (list (+ x0 b) (- y0 d00 2)))
(command "line"(list x0 (+ y0 d00 2)) (list (+ x0 2) (+ y0 d00)) (list (- (+ x0 b) 2) (+ y0 d00))
(list (+ x0 b) (+ y0 d00 2)) )
(command "line"(list x0 (- y0 d00 2)) (list (+ x0 2) (- y0 d00)) (list (- (+ x0 b) 2) (- y0 d00)) (list (+ x0 b) (- y0 d00 2)) )
(command "line"(list (+ x0 2) (- y0 d00)) (list (+ x0 2) (+ y0 d00)) )
(command "line"(list (- (+ x0 b) 2) (- y0 d00)) (list (- (+ x0 b) 2) (+ y0 d00)) )
(command "line"(list x0 (+ y0 d22)) (list (+ x0 m) (+ y0 d11)) (list (- (+ x0 b) m) (+ y0 d11)) (list (+ x0 b) (+ y0 d22)) )
(command "line"(list x0 (- y0 d22)) (list (+ x0 m) (- y0 d11)) (list (- (+ x0 b) m) (- y0 d11)) (list (+ x0 b) (- y0 d22)) )
(command "layer" "s" "2" " ")
(setq a d)
(setq a1 d1)
(setq a2 d2)
(setq a3 (+ d 8))
(setq a4 b)
(setq d (itoa d) d1 (itoa d1) d2 (itoa d2) b (itoa b) c (itoa (+ d 8)))
(setq d (strcat "%%c" d) d1 (strcat "%%c" d1) d2 (strcat "%%c" d2) c (strcat "%%c" c))
(command "dim")
(command "dimtxt" "8")
(command "hor"(list x0 y0) (list (+ x0 b) y0) (list x0 (- y0 d11 14)) b)
(command "ver"(list x0 (- y0 d00)) (list x0 (+ y0 d00)) (list (+ x0 (/ a4 2.0)) y0) d)
(command "ver"(list x0 (- y0 d11)) (list x0 (+ y0 d11)) (list (+ x0 a4 30) y0) d1)
(command "ver"(list x0 (- y0 d22)) (list x0 (+ y0 d22)) (list (+ x0 a4 20) y0) d2)
(command "ver"(list x0 (- y0 d00)) (list x0 (+ y0 d00 8)) (list (+ x0 a4 10) y0) c)
(command "exit")
)
运行时总说“; 错误:输入的列表有缺陷”
▼优质解答
答案和解析
(command "limits" (list 0 0) (list (+ x0 b 50) (+ y0 d11 50))
有误
缺少括号
应为:(command "limits" (list 0 0) (list (+ x0 b 50) (+ y0 d11 50)))
而且你画直线的命令用的也不对,自己查书对照一下
有误
缺少括号
应为:(command "limits" (list 0 0) (list (+ x0 b 50) (+ y0 d11 50)))
而且你画直线的命令用的也不对,自己查书对照一下
看了 autolisp改错(def...的网友还看了以下:
将字母组成单词,并译成汉语1.m,e,r,m,u,s,汉语2.u,l,t,e,c,u,r,汉语3. 2020-06-04 …
为什么usual前面用an?我做一道题目,Yesterdayisusualday.本来是道很简单的 2020-06-14 …
函数u=x2+y2+z2在点M(1,1,1)处沿曲面2z=x2+y2在点M处的外法线方向l的方向导 2020-06-15 …
电压与时间的乘积是什么电感与电流的乘积是什么U=L△I/t就是这个公式中,就成Ut=L△I,请问“ 2020-07-22 …
matlab解一个方程组,lu函数出问题,A=[3,-2,1;2,6,-4;-8,-2,5]b=[ 2020-07-24 …
魔方最后一步顶部棱快归位的公式,我记的是L'UL'U'L'U'.什么的 2020-10-31 …
大家快近来,悬赏20哦写出以下英文的中文意思哦~~What'sthisinEnglish.It'sa 2020-11-28 …
C++解决一个程序1随机产生一个n*m矩阵输入m,n,L,U,p(p在(0,1]之间)2对矩阵中每一 2020-12-07 …
口算题7.它+它.u=0.7×16-16×0.它=6÷1.它=9.它÷它.3=它l÷l+16÷l=1 2020-12-13 …
四成四魔方,最后一步要把两个角换掉,不要什么u.l.r.f.b不要说这是国际公式,因为这个根本... 2021-01-07 …