CATIA V5 Catalog creation using .CATScript
CATIA V5 Catalog creation using .CATScript
(OP)
Hello,
I'm new to the forums so I need a little direction. I have a .CATScript file that I know worked in either older releases of V5 and/or prior to Windows 7. I am getting errors now and am wondering if this is a place I can get some help with this. I don't have any experience with Visual Basic but need to get this project going while I'm trying to learn. If this is not the forum to get this help, please let me know.
Thank you.
I'm new to the forums so I need a little direction. I have a .CATScript file that I know worked in either older releases of V5 and/or prior to Windows 7. I am getting errors now and am wondering if this is a place I can get some help with this. I don't have any experience with Visual Basic but need to get this project going while I'm trying to learn. If this is not the forum to get this help, please let me know.
Thank you.





RE: CATIA V5 Catalog creation using .CATScript
What CATIA release? V5 or V6? Win 7 OS (Pro, Home)? Error message ?
Even better, let us see the code (or part of)...
Anyway, is the only CATIA forum here, is the right place to get help if you give enough info about the problem...
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA V5 Catalog creation using .CATScript
indocti discant et ament meminisse periti
RE: CATIA V5 Catalog creation using .CATScript
Thanks.
RE: CATIA V5 Catalog creation using .CATScript
Did you tried to "Google" for that error? I believe there are multiple answers for that.
Please check here
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA V5 Catalog creation using .CATScript
Yes I did. I actually found the first article that shows up in your link. I tried some of the code but being a complete newbie on VB I just couldn't get it to work. I was just hoping to find someone like me, a CATIA user that's already gone through the problem.
Thanks
RE: CATIA V5 Catalog creation using .CATScript
Is not the whole code, is just that part till changing the extension of the picked file from txt to csv and catalog.
CODE --> CATScript
Language = "VBSCRIPT" Sub CATMain() Set wShell=CreateObject("WScript.Shell") Set oExec=wShell.Exec("mshta.exe ""about:<input type=file id=FILE><script>FILE.click();new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);</script>""") sFileSelected = oExec.StdOut.ReadLine Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.GetFile(sFileSelected) szOpenFileName = objFSO.GetFileName(objFile) ' Check if file name ends with ".txt". If (Right(LCase(objFile.Name), 4) = ".txt") Then ' Rename the file. strOldName = objFile.Path strPath = objFile.ParentFolder strName = objFile.Name ' Change name by changing extension to ".csv" strName = Left(strName, Len(strName) - 4) & ".csv" strNewName = strPath & "\" & strName ' Rename the file. objFSO.CopyFile strOldName, strNewName ' Change name by changing extension to ".catalog" strName1 = Left(strName, Len(strName) - 4) & ".catalog" strNewName1 = strPath & "\" & strName1 ' Rename the file. objFSO.CopyFile strOldName, strNewName1 End If szSaveFileName = strNewName szCatalogFileName = strNewName1 MsgBox szSaveFileName & " " & szCatalogFileName End SubRegards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU