{"id":157963,"date":"2022-06-06T09:58:11","date_gmt":"2022-06-06T09:58:11","guid":{"rendered":"\/knowledge\/forums\/topic\/how-can-i-extract-results-on-beam-elements-in-mechanical-and-store-these-results-into-a-file\/"},"modified":"2022-06-06T09:58:11","modified_gmt":"2022-06-06T09:58:11","slug":"how-can-i-extract-results-on-beam-elements-in-mechanical-and-store-these-results-into-a-file","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/how-can-i-extract-results-on-beam-elements-in-mechanical-and-store-these-results-into-a-file\/","title":{"rendered":"How can I extract results on beam elements in Mechanical and store these results into a file ?"},"content":{"rendered":"<p>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. <br \/>This script has to be copied\/pasted in a command object under Solution.<br \/>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.<\/p>\n<p>\/post1<br \/>set,last<br \/>esel,s,ename,,188  ! selects all beams in the database<br \/>*GET,nb_elem,elem,0,count<br \/>*DIM,resultats,ARRAY,nb_elem,2<br \/>ne_current = 0<br \/>*DO,i,1,nb_elem<br \/>ne_current = ELNEXT(ne_current)<br \/>resultats(i,1)=ne_current<br \/>*get,resultats(i,2),elem,ne_current,smisc,31<br \/>*ENDDO<br \/>*CFOPEN,Beam_result,txt,_wb_userfiles_dir(1)<br \/>*VWRITE,<br \/>(&#8216;Node number &#8216;,&#8217;SDIR&#8217;)<br \/>*VWRITE,resultats(1,1),resultats(1,2)<br \/>((F5.0,TL1,&#8217; &#8216;),(F12.3,&#8217; &#8216;))<br \/>*CFCLO<br \/>ALLS<\/p>\n","protected":false},"template":"","class_list":["post-157963","topic","type-topic","status-publish","hentry","topic-tag-apdl","topic-tag-beam188","topic-tag-extract","topic-tag-results","topic-tag-script"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_bbp_last_active_time":["06-06-2022 20:20"],"_bbp_forum_id":["27789"],"_btv_view_count":["7008"],"_bbp_likes_count":["0"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/157963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/157963\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=157963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}