如果是在现有的一张图上修改少量的东西而形成更多的文件,试试下面的代码,打印可自己添加或用批处理- (defun c:test (/ END NEW-NAME NEW-NAME2 WJLJ WJMXH WJS YSWJM)
- (setq wjlj (getvar "DWGPREFIX"))
- (setq wjmxh (GETINT "\n请输入文件起始序号:"))
- (setq wjs (GETINT "\n请输入欲形成文件数:"))
- (setq yswjm (car (ENTSEL "\n选择原文件名LOCATION: ")))
- (setq ystxh (car (ENTSEL "\n选择原图序号DRAWING NO: ")))
- (setq wjtxh (GETINT "\n请输入图起始序号:"))
- (command "setvar" "filedia" "0")
- (REPEAT wjs
- (setq new-name (STRCAT (itoa wjmxh) "-SHANGLIZHONGXUE.DWG"))
- (setq new-name1 (STRCAT wjlj new-name))
- (setq end (entget yswjm))
- (setq end (subst (cons 1 new-name) (assoc 1 end) end))
- (ENTMOD end)
- ;;;;;;;;;;;;;;;;;;;;;
- (setq new-name (STRCAT "SHANGGAO-" (itoa wjtxh)))
- (setq end2 (entget ystxh))
- (setq end2 (subst (cons 1 new-name) (assoc 1 end2) end2))
- (ENTMOD end2)
- ;;;;;;;;;;;;;;;;;;;;;
- (command "-wblock" new-name1 "*")
- (command "oops")
- (setq wjmxh (1+ wjmxh))
- (setq wjtxh (1+ wjtxh))
- )
- (command "setvar" "filedia" "1")
- )
|