无论如何,试试这个程序,让我知道;
- (defun c:Test (/ s _t)
- ;; Tharwat 14.03.2016 ;;
- (defun _t (obj / att)
- (if
- (vl-some '(lambda (x)
- (and (wcmatch (strcase (vla-get-tagstring x)) "HEADER6,HEADER_N13")
- (setq att x))
- )
- (vlax-invoke obj 'getattributes)
- )
- (vla-put-Layeron (vlax-ename->vla-object (tblobjname "LAYER" "REACTOR LAYER"))
- (if (eq (vla-get-textstring att) "") 0 1))
- )
- )
- (cond ( (not (tblsearch "LAYER" "REACTOR LAYER"))
- (alert "Layer name <REACTOR LAYER> is not found in this drawing !")
- )
- ( (and (princ "\nPick on Attributed Block: ") (setq s (ssget "_+.:S" '((0 . "INSERT")(66 . 1)))))
- (_t (vlax-ename->vla-object (ssname s 0)))
- )
- (t (princ "\nNothing selected or selection is not attributed block !")
- )
- )
- (princ)
- )(vl-load-com)
|