怎么不在标题里说清楚啊 看看这个对你吗?
- (defun C:gai (/ ss p0 h i ent ent1 str ) (command "undo" "be") (if (setq SS (ssget ":E" '((0 . "INSERT") (66 . 1)))) (progn (setq p0 (getpoint "\n指定书写文字的基点:")) (setq h (getreal "\n指定文字的高度:")) (setvar "cmdecho" 0) (setvar "osmode" 0) (setq I -1) (repeat (sslength SS) (setq ENT (entget (ssname SS (setq I (1+ I)))) ENT1 ENT ) (while (= (cdr (assoc 0 (setq ENT1 (entget (entnext (cdr (assoc -1 ENT1))))) ) ) "ATTRIB" ) (if (= (cdr (assoc 2 ENT1)) "LENGTH") (progn (setq str (cdr (assoc 1 ENT1))) (Command "_.TEXT" "_S" "standard" "j" "mc" p0 h 0 str) ) ) ) ) ) ) (setvar "osmode" 15359) (command "undo" "e") (prin1))
|