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


CNEXT CatScriptErrorMessages - ScriptingERR_1002

CNEXT CatScriptErrorMessages - ScriptingERR_1002

CNEXT CatScriptErrorMessages - ScriptingERR_1002

Hello everyone,
I really could use some help for my issue!

I have to run a Macro.CATScript and every time I do, I get this error!

CNEXT CatScriptErrorMessages - ScriptingERR_1002
Source: CATIAFileSystem
Description: The method GetFile failed

I don't know what to do because I am not an expert in VBA language and I actually don't know how to write a Macro in a correct way!
The one I have is my tutor's and it works fine on his computer!

I attach here the first few lines of my Macro which reads vectors from a file.txt and transforms them in points coordinates.. or at least it should do it!


Sub CATMain()

' copy data from data.txt
Const ReadTxtFile = "x_profilo_up.txt"
' attenzione il file txt deve essere scritto con le virgole e senza righe vuote
Dim oFile As File
Set oFile = CATIA.FileSystem.GetFile (ReadTxtFile)
Dim oStream As TextStream
Set oStream = oFile.OpenAsTextStream ("ForReading")
Do While Not (oStream.AtEndOfStream)
Dim xup(201)
For i = 1 To 201
xup(i) = oStream.ReadLine

Thanks for anyone's attention and help!

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!


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close