我们开始吧,试试这个程序。
- (defun c:Test nil
- ;;------------------------------------;;
- ;; Tharwat 20.05.2015 ;;
- ;; Modify Title Blocks that have ;;
- ;; Tag name "LAYOUT" wiht its ;;
- ;; location is each Layout's Name ;;
- ;;------------------------------------;;
- (vlax-for x (vla-get-layouts (vla-get-ActiveDocument (vlax-get-acad-object)))
- (if (/= (vla-get-name x) "Model")
- (vlax-for b (vla-get-block x)
- (and (eq (vla-get-objectname b) "AcDbBlockReference")
- (eq (vla-get-effectivename b) "TILTEBLOCK")
- (vl-some
- '(lambda (a)
- (if
- (eq "LAYOUT" (strcase (vla-get-tagstring a)))
- (vla-put-textstring a (vla-get-name x))
- )
- )
- (vlax-invoke b 'getattributes)
- )
- )
- )
- )
- )
- (princ)
- )(vl-load-com)
|