 - (defun c:mjj()
- (setvar "cmdecho" 0)
- (command "style" "宋体" "宋体" "0" "1" "0" "" "") ;设定字体
- (setq en (entsel "请选择对象:"))
- (command "area" "o" en)
- (setq a (getvar "area"))
- (redraw (car en) 3)
- (setq s (strcat "S=" (rtos a 2 2)))
-
- (setq #Final (grread T 4 4))
-
- (setq bb (cadr #final))
- (entmake
- (list
- '(0 . "text")
- '(100 . "AcDbEntity")
- '(100 . "AcDbText")
- '(7 . "宋体")
- (cons 1 s)
- (cons 10 bb)
- ;(cons 50 ang)
- '(72 . 1)
- '(40 . 3)
- (cons 11 bb)
- );end list
- );end entmake
- (setq en1 (entlast))
- (while (eq 5 (car (setq #Final (grread T 4 4))))
- (setq b (cadr #final))
-
- (setq en_data (entget en1))
- (setq oh (assoc 10 en_data))
- (setq ol (cons 10 b))
-
- (setq en_data (subst ol oh en_data))
- (entmod en_data)
-
- );end while
- );end
|