Left Sidebar
Right Sidebar
06/07/31: CATPart to STP (Windows)
A batch convert CATScript
Language="VBSCRIPT"
Sub CATMain()
folderinput = InputBox ("Take your files from here","Input","C:\tempin\",2000,4000)folderoutput = InputBox ("Put your files here","Output","C:\tempout\",2000,4000)
Dim fs, f, f1, fc, sSet fs = CreateObject("Scripting.FileSystemObject")Set f = fs.GetFolder(folderinput)Set fc = f.Files
For Each f1 in fc
Dim PartDocument1 'As DocumentSet documents1 = CATIA.DocumentsDim document1 'As Document
INTRARE = folderinput & f1.nameSet PartDocument1 = CATIA.Documents.Open(INTRARE)
IESIRE = folderoutput & f1.name & ".stp"PartDocument1.ExportData IESIRE, "stp"
s = s & f1.names = s & vbCrLf
CATIA.ActiveDocument.Close
Next
End Sub
Regards
Language="VBSCRIPT"
Sub CATMain()
folderinput = InputBox ("Take your files from here","Input","C:\tempin\",2000,4000)folderoutput = InputBox ("Put your files here","Output","C:\tempout\",2000,4000)
Dim fs, f, f1, fc, sSet fs = CreateObject("Scripting.FileSystemObject")Set f = fs.GetFolder(folderinput)Set fc = f.Files
For Each f1 in fc
Dim PartDocument1 'As DocumentSet documents1 = CATIA.DocumentsDim document1 'As Document
INTRARE = folderinput & f1.nameSet PartDocument1 = CATIA.Documents.Open(INTRARE)
IESIRE = folderoutput & f1.name & ".stp"PartDocument1.ExportData IESIRE, "stp"
s = s & f1.names = s & vbCrLf
CATIA.ActiveDocument.Close
Next
End Sub
Regards
Category: Developer's corner
Posted by: ferdo
pdubernet wrote:
I am interested to do the reverse task.
I have a big .stp file (120Mo) and CATIA run under windows XP.
Can you help me to do that in bach mod without open a CATIA GUI?
Best regards
Patrick