pnavy
Mechanical
- Feb 5, 2014
- 19
Hello,
since I wanted to reply on all ready open thread but i could not I decided to open a new thread, for that if I am wrong I am sorry!
I have started to get acquainted with some basic macro programs for catia and I found macro to convert from drawing to pdf.
The problem is that I get compile error (byref argument type mismatch) message every time, seems that is something wrong with IESIRE and INTRARE statement.
I use catia v5r20
so below is quote from user ferdo from 20 Mar 06 18:43 source
---------------------------------------------------------------------------------------------------------
Language="VBSCRIPT"
Sub CATMain()
folderinput = InputBox ("Put your files here","Input","C:\temp\",2000,4000)
folderoutput = InputBox ("Take your files from here","Output","C:\tempout\",2000,4000)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderinput)
Set fc = f.Files
For Each f1 in fc
Dim PartDocument1 As Document
Set documents1 = CATIA.Documents
Dim document1 As Document
INTRARE = folderinput & f1.name
Set PartDocument1 = CATIA.Documents.Open(INTRARE)
IESIRE = folderoutput & f1.name & ".pdf"
PartDocument1.ExportData IESIRE, "pdf"
s = s & f1.name
s = s & vbCrLf
CATIA.ActiveDocument.Close
Next
End Sub
---------------------------------------------------------------------------------------------------------
since I wanted to reply on all ready open thread but i could not I decided to open a new thread, for that if I am wrong I am sorry!
I have started to get acquainted with some basic macro programs for catia and I found macro to convert from drawing to pdf.
The problem is that I get compile error (byref argument type mismatch) message every time, seems that is something wrong with IESIRE and INTRARE statement.
I use catia v5r20
so below is quote from user ferdo from 20 Mar 06 18:43 source
---------------------------------------------------------------------------------------------------------
Language="VBSCRIPT"
Sub CATMain()
folderinput = InputBox ("Put your files here","Input","C:\temp\",2000,4000)
folderoutput = InputBox ("Take your files from here","Output","C:\tempout\",2000,4000)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderinput)
Set fc = f.Files
For Each f1 in fc
Dim PartDocument1 As Document
Set documents1 = CATIA.Documents
Dim document1 As Document
INTRARE = folderinput & f1.name
Set PartDocument1 = CATIA.Documents.Open(INTRARE)
IESIRE = folderoutput & f1.name & ".pdf"
PartDocument1.ExportData IESIRE, "pdf"
s = s & f1.name
s = s & vbCrLf
CATIA.ActiveDocument.Close
Next
End Sub
---------------------------------------------------------------------------------------------------------