Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fastest way to convert CATDrawing to PDF

Status
Not open for further replies.

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.
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.
 
Replies continue below

Recommended for you

You can find attached a macro that I use, I think it was also downloaded from here a few years ago.

You need a structure like below:

Capture_jr0jzq.png


The catia drawings and PDF and DWG folders must reside in

D:\MACRO_PDF

You can change this path by editing the script.

Fist you must copy all the catdrawings in the respective structure.

Capture_l3moyz.png


You just click the desired option, PDF or DWG and the script automatically cycles through the catdrawings, dumping the PDFs and DWGs in their respective folders.

Hope this helps !

Best regards,
Costin Ruja
 
I haven't tried it in batch mode but I think it should work.

Best regards,
Costin Ruja
 
jzecha I was using your macro at the beginning of this post to open and export CATDrawings and I am running into the issue of it opening the same drawing twice. File names are "700JSC-1048_SHT_1" and "700JSC-1048A_SHT_1" and sometimes skips over other ones. Thanks for you time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor