You can watch the example of Catia toolbar tutorial, the same idea for creating application from visual Studio The working code is like the script described
Hi, Rolland I wrote Python code to use export_data export .pdf,.dxf. I fond that can not export only Sheet.1. Can you help me solve this problem? For my solution,I use python os library to delete the sheets which I don’t want.
Hello Rolland! I made my own coding and I got a problem. So I started looking for a solution and I thought you had it BUT! You have the same problem like me. The documents with names with DOTS in the middle, will export without the extension document (.pdf or .stp or .igs etc.) Could you know how to solve this?
Sub CatMain() pathInputBox = InputBox("Enter path") Set objFSO = Createobject("Scripting.FileSystemObject") Set oFolder = objFSO.GetFolder(pathInputBox) CATIA.DisplayFileAlerts = False For Each oFile in oFolder.Files if right(oFile.Name,8) = ".CATPart" then Set OProdDoc = CATIA.Documents.Open( oFolder & "\" & oFile.Name) newname = Replace(oFile.Name,".CATPart","") OProdDoc.ExportData oFolder & "\" & newname, "stp" oProdDoc.close() end if if right(oFile.Name,11) = ".CATProduct" then Set OProdDoc = CATIA.Documents.Open( oFolder & "\" & oFile.Name) newname = Replace(oFile.Name,".CATProduct","") OProdDoc.ExportData oFolder & "\" & newname, "stp" oProdDoc.close() end if Next End sub
how about 3de v6 version? there is no API( called ExportData ) in CATIA VBA to export model to stp/pdf
Sorry I didn't understand the question
hello, can you share user form application script , can you share script file to directly run. it will help a lot
Looks Good and interesting with the app, But it is possible to explain us how the app has been created ??
You can watch the example of Catia toolbar tutorial, the same idea for creating application from visual Studio
The working code is like the script described
Hi, Rolland I wrote Python code to use export_data export .pdf,.dxf. I fond that can not export only Sheet.1. Can you help me solve this problem? For my solution,I use python os library to delete the sheets which I don’t want.
Hello Rolland! I made my own coding and I got a problem. So I started looking for a solution and I thought you had it BUT! You have the same problem like me. The documents with names with DOTS in the middle, will export without the extension document (.pdf or .stp or .igs etc.) Could you know how to solve this?
Hello Mauricio
I've noticed that, In my case it was simple
I have replaced the dot with a space character ( the dot of the extension will remain )
Sub CatMain()
pathInputBox = InputBox("Enter path")
Set objFSO = Createobject("Scripting.FileSystemObject")
Set oFolder = objFSO.GetFolder(pathInputBox)
CATIA.DisplayFileAlerts = False
For Each oFile in oFolder.Files
if right(oFile.Name,8) = ".CATPart" then
Set OProdDoc = CATIA.Documents.Open( oFolder & "\" & oFile.Name)
newname = Replace(oFile.Name,".CATPart","")
OProdDoc.ExportData oFolder & "\" & newname, "stp"
oProdDoc.close()
end if
if right(oFile.Name,11) = ".CATProduct" then
Set OProdDoc = CATIA.Documents.Open( oFolder & "\" & oFile.Name)
newname = Replace(oFile.Name,".CATProduct","")
OProdDoc.ExportData oFolder & "\" & newname, "stp"
oProdDoc.close()
end if
Next
End sub
Hi, Rolland
your code is working
thank you