Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

CNEXT CatScriptErrorMessages - ScriptingERR_1002

Status
Not open for further replies.

fuffina13

Aerospace
Feb 26, 2015
1
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!

Language="VBSCRIPT"

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 Line As CATBSTR
Dim xup(201)
For i = 1 To 201
xup(i) = oStream.ReadLine
Next
Loop
oStream.Close

Thanks for anyone's attention and help!
 
Replies continue below

Recommended for you

Is there some reason you're not posting in the CATIA forum?

TTFN
faq731-376
7ofakss

Need help writing a question or understanding a reply? forum1529


Of course I can. I can do anything. I can do absolutely anything. I'm an expert!
There is a homework forum hosted by engineering.com:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor