Ansys Learning Forum › Forums › Discuss Simulation › General Mechanical › Use a do loop to apply several named tabular loads › Reply To: Use a do loop to apply several named tabular loads
Below is a script demonstrating the technique to use table parameters having names ending with a sequential value within a do loop. For testing I just list the file contents so you would insert the *dim prior to your do loop and then the do loop contents of my file (after the *do up to the *enddo) into your do loop. Then uncomment the /input. The second line that starts with str(1) is set up so that you can easily change it to 'all' or a number such as '24'. *dim,str,string,80 *do,jj,1,100 ! *stat,jj ! str(1)='sfa,' str(1)=strcat(str(1),'area_num') str(1)=strcat(str(1),',') str(1)=strcat(str(1),'1,pres,%uplift') str(1)=strcat(str(1),chrval(jj)) str(1)=strcat(str(1),'%') *cfopen,cmds,inp *vwrite,str(1) %S *cfclose !/input,cmds,inp *list,cmds,inp ! ! ! *enddo