×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CATIA V5 Catalog creation using .CATScript

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.

RE: CATIA V5 Catalog creation using .CATScript

you should be able to get some help here... or on the coe forum, development and deploy section is also good for code http://www.coe.org/p/fo/si/topic=113

Eric N.
indocti discant et ament meminisse periti

RE: CATIA V5 Catalog creation using .CATScript

(OP)
Fernando,

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

Interesting problem, it took me some time to figure how to do it (with help from Google, of course smile).

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 Sub 

Regards
Fernando

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources