Hi,
I wrote a small macro the reads CATDrawing files in a directory and export them in PDF format.
Under V5R19, everything works just fine, but since we moved to V5R23, Catia freezes after
generating around 126 PDFs. The only way to get out of this state is to kill Catia from the task
manager.
We are running Windows 7.
This symptom is very solid, tried on different computer running V5R23 and got the same results.
It looks like there some settings limit that is reached.
I would really appreciate any hint on the possible cause of the problem.
Here is the code:
===========================================================================
Public Const PDF_DIR = "C:\TestPDF\"
Public Const PDF_TMP_DIR = "PDF_Temp\"
Sub CATMain()
Dim oFSO As Scripting.FileSystemObject
Dim oFolder As Scripting.Folder
Dim oFile As Scripting.File
Dim sBaseName As String
Dim lCount As Long
Set oFSO = New FileSystemObject
Set oFolder = oFSO.GetFolder(PDF_DIR)
lCount = 0
For Each oFile In oFolder.Files
If oFile.Name Like "*R0.CATDrawing" Then
Set Doc = CATIA.Documents.Read(oFile.Path)
sBaseName = "Test_" & Trim(Str(lCount))
Doc.ExportData PDF_DIR & PDF_TMP_DIR & sBaseName, "pdf"
Doc.Close
Set Doc = Nothing
lCount = lCount + 1
End If
Next
End Sub
Thanks
I wrote a small macro the reads CATDrawing files in a directory and export them in PDF format.
Under V5R19, everything works just fine, but since we moved to V5R23, Catia freezes after
generating around 126 PDFs. The only way to get out of this state is to kill Catia from the task
manager.
We are running Windows 7.
This symptom is very solid, tried on different computer running V5R23 and got the same results.
It looks like there some settings limit that is reached.
I would really appreciate any hint on the possible cause of the problem.
Here is the code:
===========================================================================
Public Const PDF_DIR = "C:\TestPDF\"
Public Const PDF_TMP_DIR = "PDF_Temp\"
Sub CATMain()
Dim oFSO As Scripting.FileSystemObject
Dim oFolder As Scripting.Folder
Dim oFile As Scripting.File
Dim sBaseName As String
Dim lCount As Long
Set oFSO = New FileSystemObject
Set oFolder = oFSO.GetFolder(PDF_DIR)
lCount = 0
For Each oFile In oFolder.Files
If oFile.Name Like "*R0.CATDrawing" Then
Set Doc = CATIA.Documents.Read(oFile.Path)
sBaseName = "Test_" & Trim(Str(lCount))
Doc.ExportData PDF_DIR & PDF_TMP_DIR & sBaseName, "pdf"
Doc.Close
Set Doc = Nothing
lCount = lCount + 1
End If
Next
End Sub
Thanks