Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

APDL - tables and loops

Status
Not open for further replies.

Erik Panos Kostson

Structural
May 18, 2018
389
I am trying to define loads in a loop and giving them previously define tables.
Table names are t_1-t_xx, and are defined in a loop before, and that is fine.

What does not work is this:

*do,i,1,nt+1,1 ! loads
nsel,s,loc,x,(i-1)*dl

f,all,fy,%t_%i%%
allsel,all
*enddo

The highlighted part does not work.
I have also tried to put these table names in a array (string), called comp say
and then use
f,all,fy,%comp(1,i)%

But that does not work either.
This works though cmsel,s,%comp(1,i)%, at least according to some blog.
So not sure why it does not work with the f command.

any help would be much appreciated.
 
Replies continue below

Recommended for you

To answer my own question, it does not work with the f command simply, but it does work on cmsel, because that expects a string name.

Might be helpful, in case anyone would try do do something like this :).
 
Hi Erik!

Try to do the string expansion first, then apply the load using a temporary variable, something like this should work.
[pre]
*do,jj,1,4
t_name='table_%jj%'
f,all,fy,t_name
*enddo
t_name=
[/pre]

/Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor