有谁能告诉我,是否可以将一个图形中定义的变量按批处理顺序传递到另一个图形中?
在定义了一些“主”变量后,我试图在图形目录中批量运行一个例程。
例行程序只是将特定层的颜色更改为定义的颜色。我正在使用Lee Mac的批处理代码和“.-layer”命令。
我们有数百张只需要改变单层颜色的图纸;我希望能够定义新的颜色和层名称,然后运行-全局使用这些参数分层。
我已经附上了到目前为止我得到的,谢谢大家。
- (defun c:BATCHLAY (/ wfile rfile ofile dir bna)
- (setq mlna (entget (car (entsel))))
- (setq lcent (assoc 8 mlna))
- (setq lna (cdr lcent))
- (setq mcolor (getstring "Enter new layer color name:"))
- (if (and (setq wfile "C:\\lay_color.scr")
- (setq rfile (getfiled "\nSelect File from Directory to Read: " "" "dwg" ))
- (progn
- (setq ofile (open wfile "w"))
- (foreach x (vl-directory-files (setq dir (vl-filename-directory rfile)) "*.dwg" 1)
- (write-line
- (strcat "open "" dir "\" x "" (c:LAYCLR) qsave close")
- ofile)
- )
- (close ofile)
- (command "script" wfile)
- )
- (princ "\n<!> File Selection Error <!>"))
- (princ)
- )
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (defun c:LAYCLR ()
- (command ".-layer" "C" mcolor lna "")
- (princ)
- )
|