试试这个。。。如果这能满足你的要求,请告诉我。
- (defun c:Test (/ hgt wid thk pt l p1 p2 p3 p4 p5 p6 p7 ct)
- (if
- (and
- (setq hgt (getdist "\nEnter the height: "))
- (setq wid (getdist "\nEnter the width: "))
- (setq thk (getdist "\nEnter the thickness: "))
- (if (> wid (* 2. thk))
- t
- (progn
- (alert
- "Width of outter border must be bigger two times at least than the Thickness !"
- )
- nil
- )
- )
- (setq pt (getpoint "\n Specify point :"))
- )
- (progn
- (setq l (- wid (* thk 2.))
- p1 (polar pt 0. wid)
- p2 (polar p1 (* pi 1.5) hgt)
- p3 (polar p2 pi wid)
- p4 (polar (polar pt 0. thk) (* pi 1.5) thk)
- p5 (polar p4 0. l)
- p6 (polar p5 (* pi 1.5) l)
- p7 (polar p6 pi l)
- ct (inters p4 p6 p5 p7)
- )
- (command "_.rectang" "_none" pt "_none" p2)
- (command "_.rectang" "_none" p4 "_none" p6)
- (entmake
- (list '(0 . "CIRCLE") (cons 10 ct) (cons 40 (/ l 2.)))
- )
- )
- )
- (princ)
- )
|