- (defun c:tt ()
- (princ "启动命令为tt")
- (defun sub-ob (w d pt1 ro / pt2 pt3 pt4 aa pt)
- (setq pt2 (polar pt1 0 w)
- pt3 (polar pt2 (/ pi 2) d)
- pt4 (polar pt3 pi w)
- )
- (command "pline" pt1 pt2 "a" pt3 "l" pt4 "a" pt1 "")
- (setq aa (entlast)
- pt (inters pt1 pt3 pt2 pt4)
- )
- (command "move" aa "" pt pt1 "")
- (if (/= ro 0)
- (command "rotate" aa "" pt1 ro)
- )
- (command "chprop" aa "" "c" 7 "")
- )
- (setvar "osmode" 0)
- (setq w0 (getdist "\n腰孔长:[10]"))
- (setq d (getdist "\n宽:[5]"))
- (or w0 (setq w0 10))
- (or d (setq d 5))
- (setq w (- w0 d))
- (setq ro (getreal "\n旋转角度:[0]"))
- (initget "Y N")
- (setq del (getkword "[删除圆(Y)/(N)]"))
- (if del
- (setq del (strcase del))
- )
- (if (setq ss (ssget '((0 . "CIRCLE"))))
- (progn
- (setq n 0)
- (repeat (sslength ss)
- (setq pt1 (cdr (assoc 10 (entget (ssname ss n))))
- n (1+ n)
- )
- (sub-ob w d pt1 ro)
- )
- (cond ((or (= del nil) (= del "Y")) (command "erase" ss ""))
- (t (command "chprop" ss "" "c" 1 ""))
- )
- )
- )
- (princ)
- )
|