We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.

Ansys Learning Forum Forums Discuss Simulation General Mechanical How to write an array to text file ? Reply To: How to write an array to text file ?

Md_Salem
Subscriber

I solved the first problem by using *MWRITE command after the DO loop and it worked properly.

Still the second problem for me : how to set parameter “my_energy” to the highest value of the steps :


*DIM,energy_array,ARRAY,10
/POST1
i=1

*DO, step, 1,19, 2
set,,,,,,,step ! store results for set step
ESEL,S,ENAME,,185
etable,energy,sene
ssum

*get,my_energy,ssum,,ITEM,energy
energy_array(i)= my_energy
ETABLE,CLEAR
ALLSEL
i=i+1
*ENDDO

*MWRITE,energy_array,C:\Users\MD\Desktop\ENERGIES,TXT
(F18.10)

Regads