chen2j 发表于 2015-1-6 22:06:31

close函数是否可以更改CAD文件名?

帮助里提示:
object.Close( [, FileName]) ObjectDocument, Documents
The document to close. SaveChangesVariant; input-only; optional
(Not applicable when called from Documents collection.)
Specifies if the drawing is to be saved or not. TRUE: Save the drawing. FALSE: Do not save the drawing. FileName
String; input-only; optional
(Not applicable when called from Documents collection.)
The name to assign to the drawing. If no name is provided when saving a drawing for the first time, the drawing will be saved using the VBA project information: ThisDrawing.Path\ThisDrawing.Name.
FileName参数应该是CAD文档保存的名字,这样应该是可以为CAD文件改名吧?
这个如果想使用怎么操作?改了好多次都不成功。
另外,不知道在VBA里面实现CAD改名有没有什么更方便的做法?我现在是另存为,然后在调lisp删除之前的文件,有可能会不成功。


zzyong00 发表于 2015-1-7 09:38:07

没太明白你的需求,改名当然用saveas了
也可以在drawing关闭后用Name   As改名

chen2j 发表于 2015-1-12 21:14:38

ok,解决了,saveas + kill可以实现改名了。
页: [1]
查看完整版本: close函数是否可以更改CAD文件名?