×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Fastest way to convert CATDrawing to PDF

## Fastest way to convert CATDrawing to PDF

(OP)
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 --> CATScript

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.

### RE: Fastest way to convert CATDrawing to PDF

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:

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.

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

### RE: Fastest way to convert CATDrawing to PDF

I haven't tried it in batch mode but I think it should work.

Best regards,
Costin Ruja

### RE: Fastest way to convert CATDrawing to PDF

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.

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!