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!

PDF File generated from macro is "type 30" file

Status
Not open for further replies.

hims1980

Aerospace
Jul 9, 2012
54
Hi! Ferdo,

I used the catscript (from chm file) of converting cat drawing into pdf file & runned a macro, but the pdf file generated is showing as "type 30" file & not pdf.

I am following the same instructions like i have copied my all the cat drgs in C:temp folder.

Can you please provide some solution ?


Regards,

Himanshu
 
Replies continue below

Recommended for you

Hi!

Below is the script:

[highlight #000000]Language="VBSCRIPT"

Sub CATMain()
MsgBox "This will not turn in black your background view and at the end the drawing will be closed with last save done manually"
Dim theDrawing As DrawingDocument

Set theDrawing = CATIA.ActiveDocument
Dim mySelection As Selection

Set mySelection = theDrawing.Selection
mySelection.Search "Type=*,scr"
Set visPropertySet1 = mySelection.VisProperties

visPropertySet1.SetRealColor 0,0,0,0

mySelection.Clear
theDrawing.ExportData "C:\temp\" & "\" & Left(CATIA.ActiveDocument.Name, Len(CATIA.ActiveDocument.Name) - 11), "pdf"
theDrawing.Close
End Sub[/highlight]

The CATIA Version i use is CATIA V5 R20 SP6


Regards,

Himanshu
 
Hi!

I am sorry for my highlighting the script.

Please find below again

Language="VBSCRIPT"

Sub CATMain()
MsgBox "This will not turn in black your background view and at the end the drawing will be closed with last save done manually"
Dim theDrawing As DrawingDocument

Set theDrawing = CATIA.ActiveDocument
Dim mySelection As Selection

Set mySelection = theDrawing.Selection
mySelection.Search "Type=*,scr"
Set visPropertySet1 = mySelection.VisProperties

visPropertySet1.SetRealColor 0,0,0,0

mySelection.Clear
theDrawing.ExportData "C:\temp\" & "\" & Left(CATIA.ActiveDocument.Name, Len(CATIA.ActiveDocument.Name) - 11), "pdf"
theDrawing.Close
End Sub


Regards,

Himanshu
 
Play a little bit with the line bellow by replacing 11 with 10 or 12 (or other figures) and see what is going on (try to understand how string manipulation is working).

theDrawing.ExportData "C:\temp\" & "\" & Left(CATIA.ActiveDocument.Name, Len(CATIA.ActiveDocument.Name) - 11), "pdf"

Why don't you use the build in CATIA command to save as pdf? Do you have some special reasons?

Regards
Fernando

 
Hi!

A bunch of cat drawings at a time of around 20 to 30 are need to be saved in PDF. That's why i selected to go for a macro.


Regards,

Himanshu

 
Ferdo, figure 10 works out for me.Thanks....

Can you please explain me the "string manipulation" for this macro ? How did to choose to edit this figure ?

If i want this macro to be edited for batch mode, how should i edit this script ? Please give any hints ?

Meanwhile, i am also thinking on that, it's not like i had simply left it on you.


Regards

Himanshu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor