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.
General

General

How can I use a *DO loop to apply several named tabular loads in Mechanical APDL?

    • FAQFAQ
      Participant

      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