Returns the document's full file name, including its path.
Example:
This example retrieves in DocFullName the Doc document's full file name.
DocFullName = Doc.FullName
The returned value is like this:
e:\users\psr\Parts\MyNicePart.CATPart作者: youngxiu 时间: 2008-9-26 18:16
谢谢,十分感谢您。但这样是用返回文件名的办法,是否有直接判断类型的办法呢?
再次感谢您。作者: dsfsdsfs 时间: 2008-9-28 22:10
TypeName(Doc)作者: cupcake 时间: 2008-10-4 18:42
楼上说的这个方法更好,我找到了示例代码:
...
' Retrieve the active document
Dim oDocument As Document
Set oDocument = CATIA.ActiveDocument
' Test the document's type, if it is not a drawing document the macro stops
If TypeName(oDocument) = "DrawingDocument" Then
Dim oDrawingDocument As DrawingDocument
Set oDrawingDocument = oDocument
Else
MsgBox "This macro can be run with a drawing document only."
Exit Sub
End If
另外,英文资料就是ds自带的,装好开发环境后就有。