


{"id":436768,"date":"2025-07-14T17:02:08","date_gmt":"2025-07-14T17:02:08","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/mapdl-post1-problem-extracting-all-substeps\/"},"modified":"2025-07-14T17:02:08","modified_gmt":"2025-07-14T17:02:08","slug":"mapdl-post1-problem-extracting-all-substeps","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/mapdl-post1-problem-extracting-all-substeps\/","title":{"rendered":"[MAPDL &#8211; POST1] Problem extracting all substeps"},"content":{"rendered":"<p>&lt;p&gt;Hi everyone,&lt;\/p&gt;&lt;p&gt;I&rsquo;m working directly in&nbsp;<strong>ANSYS Mechanical APDL (MAPDL)<\/strong>&nbsp;on a&nbsp;<strong>static structural analysis<\/strong>&nbsp;that consists of&nbsp;<strong>multiple load steps<\/strong>, each one having several&nbsp;<strong>substeps<\/strong>. The analysis was solved using&nbsp;<strong>automatic time stepping<\/strong>&nbsp;and saved results at multiple substeps per step.&lt;\/p&gt;&lt;p&gt;My goal is to:&lt;\/p&gt;<\/p>\n<ul>\n<li>&lt;p&gt;Loop over all result sets (all steps and their substeps),&lt;\/p&gt;<\/li>\n<li>&lt;p&gt;Extract nodal results (stress, EPPL, EPEL, etc.) for a group of nodes,&lt;\/p&gt;<\/li>\n<li>&lt;p&gt;Write the results for&nbsp;<strong>each substep of each load step<\/strong>&nbsp;into a&nbsp;<code>.txt<\/code>&nbsp;file.&lt;\/p&gt;<\/li>\n<\/ul>\n<p>&lt;p&gt;Here&rsquo;s the issue:&lt;\/p&gt;<\/p>\n<ul>\n<li>&lt;p&gt;The script loops from&nbsp;<code>SET,,1<\/code>&nbsp;to&nbsp;<code>SET,,48<\/code>, and I confirmed in the GUI that there are&nbsp;<strong>48 result sets<\/strong>&nbsp;corresponding to 12 steps,&nbsp;<strong>each with multiple substeps<\/strong>&nbsp;stored.&lt;\/p&gt;<\/li>\n<li>&lt;p&gt;For&nbsp;<strong>step 1<\/strong>, it correctly loops through and extracts the data for&nbsp;<strong>all substeps<\/strong>.&lt;\/p&gt;<\/li>\n<li>&lt;p&gt;However, for&nbsp;<strong>steps 2 through 12<\/strong>, it&nbsp;<strong>only processes the first substep<\/strong>&nbsp;(or repeats it), and&nbsp;<strong>fails to iterate through the rest of the substeps<\/strong>.&lt;\/p&gt;<\/li>\n<li>&lt;p&gt;As a result, I only get complete time-history data for&nbsp;<strong>step 1<\/strong>, and&nbsp;<strong>incomplete or repeated results<\/strong> for the other steps.&lt;br&gt;&lt;br&gt;<img decoding=\"async\" src=\"https:\/\/preview.redd.it\/title-mapdl-post1-problem-extracting-all-substeps-only-full-v0-ypmyft69evcf1.png?width=1164&amp;format=png&amp;auto=webp&amp;s=0c12e003e49d3c77c47252d44e83d91032c4792d\" alt=\"r\/ANSYS - Script im using.\" \/>&lt;\/p&gt;&lt;p&gt;<strong>What I&rsquo;ve tried:<\/strong>&lt;\/p&gt;\n<ul>\n<li>&lt;p&gt;Verifying that the&nbsp;<code>.RST<\/code>&nbsp;file contains all expected steps and substeps (using&nbsp;<code>SET,LAST<\/code>&nbsp;and GUI navigation).&lt;\/p&gt;<\/li>\n<li>&lt;p&gt;Using&nbsp;<code>*GET,TIMEVAL,TIME,0<\/code>&nbsp;&mdash; it returns correct time values for substeps of Step 1 but repeats or stalls after that.&lt;\/p&gt;<\/li>\n<li>&lt;p&gt;Using&nbsp;<code>SET,,i<\/code>&nbsp;indexing, assuming it walks linearly through all stored result sets, but it seems this approach breaks after the first full step.&lt;\/p&gt;<\/li>\n<\/ul>\n<p>&lt;p&gt;<strong>What I need help with:<\/strong>&lt;\/p&gt;<\/p>\n<ol>\n<li>&lt;p&gt;How can I correctly loop through all substeps of each load step in MAPDL POST1?&lt;\/p&gt;<\/li>\n<li>&lt;p&gt;Is there a way to retrieve the actual number of substeps per step dynamically?&lt;\/p&gt;<\/li>\n<li>&lt;p&gt;Do I need to use&nbsp;<code>SET,,,STEP,SUBSTEP<\/code>&nbsp;explicitly instead of flat&nbsp;<code>SET,,i<\/code>&nbsp;indexing?&lt;\/p&gt;<\/li>\n<li>&lt;p&gt;Could automatic time stepping or the way results are saved be interfering with the indexing of result sets?&lt;\/p&gt;<\/li>\n<\/ol>\n<p>&lt;p&gt;Any guidance on how to fully iterate through each substep across all steps and extract nodal data would be greatly appreciated. Let me know if posting one of the output&nbsp;<code>.txt<\/code>&nbsp;files would help illustrate the issue.&lt;\/p&gt;&lt;p&gt;Thanks in advance!&lt;\/p&gt;&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;\/p&gt;<\/li>\n<\/ul>\n","protected":false},"template":"","class_list":["post-436768","topic","type-topic","status-publish","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_forum_id":["27790"],"_bbp_topic_id":["436768"],"_bbp_author_ip":["186.79.215.156"],"_bbp_last_reply_id":["438443"],"_bbp_last_active_id":["438443"],"_bbp_last_active_time":["2025-08-02 19:41:58"],"_bbp_reply_count":["3"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["2"],"_bbp_engagement":["450554","431745"],"_btv_view_count":["1149"],"_bbp_topic_status":["unanswered"],"_bbp_notification_enabled":["450554"],"_bbp_likes_count":["1"],"_bbp_subscription":["431745","450554"]},"test":"domenico-catenaccisansano-usm-cl"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/436768","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/436768\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=436768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}