- (defun c:tt ()
- "画指定宽度矩形并填充"
- (setq ll (getdist "\n矩形长度<1200>: "))
- (or ll (setq ll 1200.))
- (setq ww (getdist "\n矩形宽度<300>: "))
- (or ww (setq ww 300.))
- (setq th (getdist "\n矩形字高<100>: "))
- (or th (setq th 100.))
- (setvar "hpname" "STARS")
- (setvar "HPSCALE" 10)
- (setvar "hpang" 0)
- (while (setq p0 (getpoint "\n中心点<退出>: "))
- (setq p1 (mapcar '+ p0 (list (* ll -0.5) (* ww -0.5)))
- p2 (mapcar '+ p0 (list (* ll 0.5) (* ww 0.5)))
- )
- (command "rectang" "non" p1 "non" p2)
- (setq s1 (entlast))
- (command "-hatch" "s" s1 "" "")
- (setq tx (strcat "XF" (rtos ww 2 0) " F"))
- (setq pt (mapcar '+ p0 (list 0 (+ (* ww 0.5) (* th 0.75)))))
- (command "text" "j" "mc" "non" pt th 0 tx)
- )
- (princ)
- )
|