程式用多了后,给自己个省事的套用代码
dos_copy
--------------------------------------------------------------------------------
Copies a single file or multiple files.
The function can be used to copy files from one directory to another, or from one drive to another.
Syntax
(dos_copy source destination)
Parameters
source
The source file or files. source can contain wildcard characters ("*" and "?").
destination
The destination path or file.
Returns
T if successful.
nil on error.
Example
Command: (dos_copy "c:\\program files\\autocad 2002\\drawing1.dwg" "c:\\program files\\autocad 2002\\drawing2.dwg")
T
Command: (dos_copy "c:\\program files\\autocad 2002\\drawing1.dwg" "c:\\temp\\")
T
Command: (dos_copy "c:\\program files\\autocad 2002\\*.dwg" "c:\\temp\\")
T
(defun c:test (/ filename1 filename2)
(setvar "cmdecho" 0)
(setq filename1 (getfiled "源文件" "" "dwg" 0))
(setq filename2 (getfiled "目标文件" "" "dwg" 1))
(if filename1
(progn
(command "shell" (strcat "copy /y" filename1 filename2 " exit"))
(princ "\n指定插入点: ")
(command "-insert" filename2 "s" 1 pause)
)
)
(setvar "cmdecho" 1)
(princ)
) cmd 都用到这个程度了,COPY 命令中有个/Y参数就是不提示覆盖 (setq filename1 (getfiled (strcat "C:/DHPP2K6/(" F1 ")") "" "dwg" 0))
(setq filename2 (getfiled (strcat "C:/DHPP2K6/(" F2 ")")"" "dwg" 1) ) exit前面空格改为& 本帖最后由 namezg 于 2013-8-14 19:49 编辑
你的表达真的不好,你要把自己要干什么完全表达清楚,一会要复制,一会要改名,一会还要插入,你能不能把你想干的表达的详细些,已知条件及要的结果让人一目了然,就像出题不能让人看不明白啊。
是不是复制指定目录中的指定文件a到指定目录中并改名为b,如果目录中已有b,则覆盖b,然后以块的形式插入b中的图形。
乱啊!而且与不明白你为什么要改名后插入块,直接插入不行吗,一个字晕
页:
[1]
2