|
分析以下三段AUTOLISP程序,写出每个语句起什么作用?最后该程序完成什么功能?
! Y( u; r9 H! r) ]: u①: }8 z3 y# T. m
(defun c:erasescr( / l u)) R; M8 j! U/ I3 O* f
(graphscr)3 L- v. X' r' c
(setq l (getvar "limmin"))
! Z. |6 W6 b, [1 p( B7 o(setq u (getvar "limmax"))+ W" L, n' D1 c3 x. G% p+ K2 {9 r/ W |
(command "erase" "W" l u “”)
& Q1 s# W/ b, @) 6 t) ?, m" I/ J0 p) E: w3 {3 O
②) r( ^3 h# X2 }: j' v3 Y( _& T2 A9 U
(defun p3 ( )
5 o1 z& @1 `% x$ l0 d(setq r (getreal “\n number:”))$ m O& j+ i- S, E4 c' G
(setq maxr r minr r)9 `6 t& b9 z8 g" _ r2 I
(while r, e f% c5 E) F- X1 p* W8 {
(if (> r maxr) (setq maxr r))
2 b B1 V* U* b/ S(if (< r minr) (setq minr r))! n9 P& t l J
(setq r (getreal “\n number<return when done>:” ))# A7 [# c+ e. {( U" Z3 H) f
)) * a0 y4 L0 S" |- s1 x
③
* T4 K8 i/ K, B7 m: d(defun c:akey (/ d h w bp ag p1 p2)+ p) `1 |: l+ r
(setq d (/ (getdist “\n d=?”) 2.0)
7 i9 c2 Z6 I( p h (getdist “\n h=?”)+ l6 c) [3 E3 R% w& f
w (/ (getdist “\n w=?”) 2.0)
, _; @/ g' I4 r0 Z- R% ~ bp (getpoint “\n center=?”)
# u/ W4 Z1 ~: G: `" J1 W2 y) U ag (atan (/ w ( sqrt (- (* d d) (* w w))))))
& q( H% m4 O+ z) P(command “pline”/ S9 N: [+ C) r0 l% t+ M) N
(setq p1 (polar bp (- ag) d))
5 c+ {7 _5 V% L2 s# i) \- _(setq p2 (list (+ (car bp) (- d h)) (cadr p1)))% E( B# o* ]* d E* |' {% y( W( |* J
(polar p2 (/ pi 2.0) (* w 2))
& N4 ^$ E( G) ?$ g1 D* G/ l; p(polar bp ag d): `, c; c8 Q: }
“a” “ce” bp p1 “”)- T" M/ Q$ h) M- b0 I: G. A- D
(setq ss (entlast))6 `, c; q8 [' h1 V! C1 r
(command “hatch” “u” 45 10 “” ss “”)
* g2 d: m: @ n: S ) |
|