试试这个,让我知道
- (defun c:INCATT2 ( / tag ss1 ) (vl-load-com)
- (setq tag "X")
- (if (setq *num2* (cond ( (getstring (strcat "\nSpecify Starting num2ber" (if *num2* (strcat " <" *num2* "> : ") ": ")))) ( *num2* )))
- (while (setq ss1 (ssget "_+.:E:S:L" '((0 . "INSERT") (66 . 1))))
- (if
- (vl-some
- (function
- (lambda ( x )
- (if (eq tag (vla-get-tagstring x))
- (not (vla-put-textstring x *num2*))
- )
- )
- )
- (vlax-invoke (vlax-ename->vla-object (ssname ss1 0)) 'getattributes)
- )
- (setq *num2* (1+ (ascii *num2*)))
- (princ (strcat tag " Attribute not found."))
- )
- )
- )
- (princ)
- )
|