伙计,很好的努力,但我相信李的观点更像这样
- (defun c:27 (/ ss)
- (setvar "cmdecho" 0)
- (While (not ss) ;Entsel lets you only have one shot at selecting and item, So while lets you have as many attemps
- (setq ss (entget (car (entsel "\nSelect text :")))))
- (if (= (cdr (assoc 8 ss)) "text") ;Useing a If statement to make sure the item is text.
- (entmod ;Entmod is a way of altering entites,
- (subst (cons 1 "MC27") (assoc 1 ss) ss)) ;I used Subst, to substatue the text already there,
- (Princ "You did not select text")
- )
- (setvar "cmdecho" 1) ; Turn cmdecho back on.
- (princ)
- )
|