Contact US

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!

*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

Problem exporting ARRAY values to txt file

Problem exporting ARRAY values to txt file

Problem exporting ARRAY values to txt file

Hi guys, I'm having some problem with exporting an ARRAY with with 15 values in 1 column to a .txt file in order to copy it to excel. I tried googling but still don't understand the format required, and the warning saying that I can't use the command *VWRITE directly in the GUI. Any help would be very appreciated.

This is my ARRAY in ansys:

This is my code to export it:


Thanks in advance.

RE: Problem exporting ARRAY values to txt file

An alternative is to export it out in market matrix file format maintained by NIST:

CODE --> apdl

*dmat, exportmatrix, D, import, APDL, c ! export to matrix file
*export, exportmatrix, mmf, mytemp.mtx 

You can then read it in Matlab (and Octave?) using mmread.m found here.

After you have the function in your path, reading it into matlab is simply:

CODE --> matlab

c = mmread('mytemp.mtx'); 


RE: Problem exporting ARRAY values to txt file

Hope this will help:

1. Create input file (extension .inp) with the text copied from the below.
2. You have to select ANSYS Batch in simulation environment tab at ANSYS Product Launcher (in graphical interface exporting to text file does not work, hence batch run required)
3. Select your job file and just created input and click Run button

Let us say your array is named array_sx(i) and is already defined and filled in ANSYS and has 100 inputs
Input content with extension .inp:


RE: Problem exporting ARRAY values to txt file

Thanks sk_cheah, but I'm not using Matlab or Octave, I want to use the data in Excel.

Vitkacy1989: Thanks for you help. I'll try that, but isn't there an easier way to export or be able to copy the array results from a list and the paste them into Excel?

RE: Problem exporting ARRAY values to txt file

What do you mean by easier? Here are two different ways to write an array which has 15 rows and 1 column to a file.

The contents of the code have to be in txt file which is run from apdl. The first command mwrite is more general.
It can write an array which has more columns than one to a file.

CODE --> apdl

!Create array and fill with ramped values
*dim, arr, array, 15,1 
*vfill, arr, ramp, 0, 100.1

*mwrite, arr, arr1, txt


This is an example how to use vwrite command to write multiple columns to file:

CODE --> apdl

*dim, arr, array, 15,2
*vfill, arr(1,1), ramp, 0, 100.1
*vfill, arr(1,2), ramp, 99, 50.2

*vwrite,arr(1,1), arr(1,2)

You might have to tweak the fortran formatting depending on your case.

RE: Problem exporting ARRAY values to txt file

If you want to use vwrite from gui you can go to Parameters --> Array Parameters --> Write To File.

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! Already a Member? Login


Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

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