Read data from txt with apdl commands inserted in tree

Options
Luiza
Luiza Member Posts: 7
Name Dropper First Comment
edited October 2023 in General Language Questions

Hello everyone!

I'm working in workbench mechanical (2022r2) in a coupled field module. I want to insert apdl commands in the tree to read a table and interpolate to get some results.
I have a file (txt with values separated by comma)with element ids and for each element i have temperature and two parameters defined. Separately i have a 3D table with a result(val) based on temperature and the two parameters. !
So in the table the value is defined as val1(param1,param2,temp).
How can i read my file and interpolate on the table with apdl commands inserted in the tree? I am new to apdl.
Is there a way to do this with mechanical scripting?

/PREP7

*DEL, model, , NOPR
*DIM, model, TABLE, 50, 20, 40
*TREAD, model, 'Model', 'table'

/INQUIRE,numlines,LINES,'test_complete','txt'
*DEL,mytable,,NOPR
*DIM,mytable,TABLE,numlines,4 !

*DEL, final_val, , nopr
*DIM, final_val, TABLE, numlines,1

*TREAD,mytable,'test_complete','txt','',,
*STATUS,mytable
*VITRP, final_val(1,1), model, mytable(3,2,), mytable(2,2,), mytable(4,2,)

FINISH
/SOLU

this is what i used. i know it's not defined properly but i can't figure out how to define it.
Any help is much appreciated!
A nice day to everyone

Answers