Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to read in a text file containing a scalar value into ansys

Status
Not open for further replies.

vinny31

Mechanical
Oct 4, 2005
48

Hi
I have a single file called Disp.inp containing one scalar value.
This scalar value is variable depending on the analysis

I wish to read in this scalar value into another analysis
can anyone help?

A * vread, *get, *tread wont work any suggestions?

regards
V
 
Replies continue below

Recommended for you

Hi,
why "won't work"? What exactly did you try? What and how gave an error?

Regards
 
Hi
the error was "Disp is not a vector"

regards
 
Hi,
without having at least basic info about the sequence of operations/commands you tried, one can only guess...
There surely is a mismatch in the declaration of the variables.
If you want to read the value from a file, the usual way is to store it in a TABLE or an ARRAY. You can not store that file's data in a scalar, even if it contains one single value. You do can declare (*DIMension) an array to have unit length, so it will expect only one value.
Any time you will have to access to this value, however, you will have to write something like blah=array(1).

Hope this throws some light somewhere...

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor