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.
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:
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?
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
(F16.2)
*cfopen,arr2,txt
*vwrite,arr(1)
(F16.2)
*cfclose
This is an example how to use vwrite command to write multiple columns to file:
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
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
Metal 3D printing has rapidly emerged as a key technology in modern design and manufacturing, so it’s critical educational institutions include it in their curricula to avoid leaving students at a disadvantage as they enter the workforce. Download Now
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
RE: Problem exporting ARRAY values to txt file
CODE --> apdl
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
Best,
Jason
RE: Problem exporting ARRAY values to txt file
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:
finish
resu
/post1
*cfopen,example_name,out
*do,i,1,100
*vwrite,array_sx(i)
(e17.10)
*enddo
/exit,nosave
RE: Problem exporting ARRAY values to txt file
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
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
This is an example how to use vwrite command to write multiple columns to file:
CODE --> apdl
You might have to tweak the fortran formatting depending on your case.
RE: Problem exporting ARRAY values to txt file