×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

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

Jobs

How to export a table of values from ansys towards Excel
2

How to export a table of values from ansys towards Excel

How to export a table of values from ansys towards Excel

(OP)
Hi everybody!!
I would like to send a table of results starting from ANSYS towards EXCEL. How can i do that please.
Thank's in advance!!
Barha.

RE: How to export a table of values from ansys towards Excel

Store them as a table or array parameter and use the *VWRITE command to write them to a *.dat file.

-Brian

RE: How to export a table of values from ansys towards Excel

Hi,

I think, the *mwrite command is more suitable for that:

CODE

*mwrite,array(1),filename,dat
(10E14.20)

The number 10 in front of E14 is the number of array columns.

Regards,
Alex

RE: How to export a table of values from ansys towards Excel

(OP)
but how to export it to excel??? please explain much more my freinds!!
Barha

RE: How to export a table of values from ansys towards Excel

Barha,
Ansys can store numbers in matrices or vector arrays which are contained within a database.  Here's a very general sample input which you would typically use to create an array, fill that array, and write it out to a file which can be used by Excel.

*DIM     ! This command is used to dimension an array parameter or table
*DO     ! Using do-loops is a convenient way to fill in parameters with multiple rows and columns.  You can have multiple do-loops within each other.  So one do-loop would fill rows, the do-loop nested within that may fill columns, you get the idea.
*VGET     ! Use this to retrieve values which are to be stored in the array parameter itself.  This may be a nodal temperature, force, anything really.
*ENDDO     !You need to end the do-loop.
*CFOPEN     !This creates and/or opens a file which output will be directed to.
*VWRITE     !This writes specific data out to the file which you have specified above.
*CFCLOS     !This closes the file when all information has been written out.

Again, this is very general and should give you a good start.  Look at these commands or perhaps find some sample macros which other people have used to do similar and you should find what you need.

Good luck,
-Brian

RE: How to export a table of values from ansys towards Excel

(OP)
Thank you Brian but it is not there my problem but it is with Excel. If for example TEMP1 is my array:
*DIM, TEMP1,20,30
*DO,I,1,20
*DO,J,1,30
TEMP1(I,J)=2*I+3*J
*ENDDO
*ENDDO
*mwrite,TEMPE,barha,dat
When I go in Excel to read this file (barha.dat) it gives me a vector with values all equal to this value: ALLS!!

RE: How to export a table of values from ansys towards Excel

No wonder that it don't works, if you don't say Ansys, how it should write the matrix. Did you used something like this in your code:

(10E14.20)

???

This sets the Format of the Numbers and MUST follow after the *mwrite command.

RE: How to export a table of values from ansys towards Excel

Biblo,
Your input was incorrect in the usage of the *DIM command.  You do not specify what type of parameter you are dimensioning with the *DIM command.  Try this:

*DIM, TEMP1,ARRAY,20,30
*DO,I,1,20
*DO,J,1,30
TEMP1(I,J)=2*I+3*J
*ENDDO
*ENDDO
*mwrite,TEMPE,barha,dat

RE: How to export a table of values from ansys towards Excel

(OP)
I forgot to write the format (10E14.20). Now, even with that, the problem still persists. I think that I do not make well the importation of data in Excel!!

RE: How to export a table of values from ansys towards Excel

(OP)
Stringmaker lolll!!
I just forgot it here not in my program. In my program i used :
*DIM,TEMP1,ARRAY,20,30
*DO,I,1,20
*DO,J,1,30
TEMP1(I,J)=2*I+3*J
*ENDDO
*ENDDO
*mwrite,TEMPE,barha,dat
(10E14.20)

RE: How to export a table of values from ansys towards Excel

(OP)
is there somethng special to do in Excel to read my file : barha.dat?

RE: How to export a table of values from ansys towards Excel

(OP)
thank you my friends!!!!
i use this format (E10.3,2X,D8.2) and it work well!!!
thank's a lot Brian and Alex
regards, Barha.

RE: How to export a table of values from ansys towards Excel

Barha, try using this input:

*DIM,TEMP1,ARRAY,20,30
*DO,I,1,20
*DO,J,1,30
TEMP1(I,J)=2*I+3*J
*ENDDO
*ENDDO
*mwrite,TEMP1,barha,dat  !in your input above the array specified was incorrect
(30F10.0)

To get Excel to read in your data just simply open the file and make sure you import it as Delimited and that Spaces and Tabs are checked as your delimiters.

-Brian

RE: How to export a table of values from ansys towards Excel

(OP)
also the error in TEMPE i just do it here not in my program.
When i used this format (E10.3,2X,D8.2) i found that Excel is not precise (it take for exemple : 1401.2 as 1400) but with your format (30F10.0) i found the right precision. So thank's a lot Brian!!!  

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!


Resources