General

General

How can I extract results on beam elements in Mechanical and store these results into a file ?

    • FAQFAQ
      Participant

      Below is a demo APDL script that will extract the element number and axial stress on node I of all BEAM188 elements, and then store this data into a file.
      This script has to be copied/pasted in a command object under Solution.
      In the Details View of the Analysis Settings, set the Output Controls for General Miscellaneous to Yes so that all SMIC and NMISC results are stored in the result file.

      /post1
      set,last
      esel,s,ename,,188 ! selects all beams in the database
      *GET,nb_elem,elem,0,count
      *DIM,resultats,ARRAY,nb_elem,2
      ne_current = 0
      *DO,i,1,nb_elem
      ne_current = ELNEXT(ne_current)
      resultats(i,1)=ne_current
      *get,resultats(i,2),elem,ne_current,smisc,31
      *ENDDO
      *CFOPEN,Beam_result,txt,_wb_userfiles_dir(1)
      *VWRITE,
      (‘Node number ‘,’SDIR’)
      *VWRITE,resultats(1,1),resultats(1,2)
      ((F5.0,TL1,’ ‘),(F12.3,’ ‘))
      *CFCLO
      ALLS