jzecha
Aerospace
- Jan 20, 2016
- 236
I am wanting to know what is the fastest way to convert CATDrawings to PDF?
I have a drawing for one of my designs that is 28 pages, customer requirements force me to have only one page per document, so I have 28 different CATDrawings.
It has become very tedious to open all the drawings and individually save them as a PDF.
I have come up with two solutions:
1. Catia Utilities PrintBatch.
I configure it to print to Adobe PDF, but I am still struggling to get my settings correct so this works correct.
Currently, regardless of my settings, it keeps outputting my drawings on 8.5 x 11 sheets.
2. A Macro I found.
This Macro works, but takes roughly 30 minutes to run through all my drawings.
I have a drawing for one of my designs that is 28 pages, customer requirements force me to have only one page per document, so I have 28 different CATDrawings.
It has become very tedious to open all the drawings and individually save them as a PDF.
I have come up with two solutions:
1. Catia Utilities PrintBatch.
I configure it to print to Adobe PDF, but I am still struggling to get my settings correct so this works correct.
Currently, regardless of my settings, it keeps outputting my drawings on 8.5 x 11 sheets.
2. A Macro I found.
Code:
Sub CatMain()
Dim fileSys
Set fileSys = CATIA.FileSystem
Dim FolderPath
FolderPath = InputBox( "Enter a folder path:", "Folder path to convert the drawings" ,sDocPath & "\\NetApp2\Engineering\_TAJ_MODELS\615128-Inbd_Flap\TAJ\RELEASE\batchpdf\DrawingtoPDF")
Dim filefolder
Set filefolder = FileSys.GetFolder(FolderPath)
Dim i as Integer
'loop through all files in the folder
For i = 1 To filefolder.Files.Count
Dim IFile
Set IFile = filefolder.Files.Item(i)
'if the file is a CATDrawing, then open it in CATIA
If InStr(IFile.Name, ".CATDrawing") <> 0 Then
Dim Doc
Set Doc = CATIA.Documents.Open(IFile.Path)
Set partDocument1 = CATIA.ActiveDocument
Dim drawingName as String
drawingName =len(CATIA.ActiveDocument.Name)
pdfName =left( CATIA.ActiveDocument.Name,drawingName-11)
'msgbox partt
PartDocument1.ExportData FolderPath &"\"& pdfName, "pdf"
'close the open drawing document
CATIA.ActiveDocument.Close()
End IF
Next 'go to the next drawing in the folder
End Sub
This Macro works, but takes roughly 30 minutes to run through all my drawings.