本帖最后由 wutao8282 于 2022-5-16 20:33 编辑
- (defun c:tt (/ f file tmp)
- (setq f (getfiled "选择文件夹并任意选取一个文件,请先剔除无需处理文件"
- "d:\"
- "dwg"
- 0
- )
- f (vl-filename-directory f)
- f (mapcar '(lambda (x) (strcat f "\" x))
- (vl-directory-files f "*.dwg" 1)
- )
- )
- (setq tmp (open (setq file (strcat (getenv "TEMP") "\\tmp.scr")) "w"))
- (foreach n f
- (write-line (strcat "_.open "" n """) tmp)
- (write-line
- "(setq ss (ssget "x" '((0 . "CIRCLE") (40 . 0.5))))
- (repeat (setq n (sslength ss))
- (setq en (ssname ss (setq n (1- n)))
- en (entget en)
- en (subst (cons 40 9) (assoc 40 en) en)
- )
- (entmod en)
- )"
- tmp
- )
- (write-line "_.qsave _.close" tmp)
- )
- (close tmp)
- (command ".script" file)
- (vl-file-delete file)
- (princ)
- )
论坛找的批量修改直径代码,跪求高手能帮忙改成圆心添加十字标,十字标的长度为10mm
|