2种方法。
使用lisp可以很容易地更改块属性,要绘制300个图形,可以使用打开dwg的脚本运行lisp并再次关闭,重复300次。你会惊讶于DWG,这项任务会很快完成。
其他方法正在使用。Net或类似的程序,你可以改变一个dwg没有打开我不能帮助这里。
下面是一个脚本,用于将所有布局的属性更改为“已发布”。更好的版本lisp需要稍微修改,可以在启动时加载一次。
- Open dwg1 (load "issued") close Y
- Open dwg2 (load "issued") close Y
- Open dwg3 (load "issued") close Y
- [code]
- [code]
- ; changes to issued for construction
- : thanks to lee mac for original code
- (vl-load-com)
- ; 1. Get current date in mm/dd/yy format.
- (defun ddmmyy (/ x today)
- (setvar "cmdecho" 0)
- (setq x (getvar "CDATE")) ; get current date
- (setq today ( rtos x 2 4)) ; convert to a string
- (setq date (strcat (substr today 7 2) "." (substr today 5 2) "." (substr today 3 2) ))
- )
- (setq oldtag1 "DRAWING_STATUS") ;attribute tag name
- (setq newstr1 "ISSUED FOR CONSTRUCTION")
- (setq oldtag2 "REV_NO") ;attribute tag name
- (setq newstr2 "0")
- (setq ss1 (ssget "x" '((0 . "INSERT") (2 . "DA1DRTXT"))))
- (setq inc (sslength ss1))
- (repeat inc
- (foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 (setq inc (1- inc)) )) 'getattributes)
- (if (= oldtag1 (strcase (vla-get-tagstring att)))
- (vla-put-textstring att newstr1)
- ) ; end if
- (if (= oldtag2 (strcase (vla-get-tagstring att)))
- (vla-put-textstring att newstr2)
- ) ; end if
- ) ; end for
- ) ;end repeat
- (setq oldtag1 "REV-NO")
- (setq newstr1 "0")
- (ddmmyy)
- (setq oldtag2 "DATE")
- (setq newstr2 date)
- (setq oldtag3 "AMENDMENT")
- (setq newstr3 "ISSUED FOR CONSTRUCTION")
- (setq ss2 (ssget "x" '((0 . "INSERT") (2 . "REVTABLE"))))
- (setq inc (sslength ss2))
- (repeat inc
- (foreach att (vlax-invoke (vlax-ename->vla-object (ssname ss2 (setq inc (1- inc)))) 'getattributes)
- (if (= oldtag1 (strcase (vla-get-tagstring att)))
- (vla-put-textstring att newstr1)
- )
- (if (= oldtag2 (strcase (vla-get-tagstring att)))
- (vla-put-textstring att newstr2)
- )
- (if (= oldtag3 (strcase (vla-get-tagstring att)))
- (vla-put-textstring att newstr3)
- )
- )
- )
- (setq ss1 nil)
- ; (setq ss2 nil)
- (princ)
|