


{"id":277580,"date":"2023-04-03T04:55:04","date_gmt":"2023-04-03T04:55:04","guid":{"rendered":"\/forum\/forums\/topic\/passing-variables-between-define_on_demand-macros\/"},"modified":"2023-04-03T05:42:18","modified_gmt":"2023-04-03T05:42:18","slug":"passing-variables-between-define_on_demand-macros","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/passing-variables-between-define_on_demand-macros\/","title":{"rendered":"Passing variables between DEFINE_ON_DEMAND macros"},"content":{"rendered":"<p>I have two define_on_demand macros called &#8220;run1&#8221; and &#8220;run2&#8221;.<\/p>\n<p>&#8220;run1&#8221; spits out an output <em><strong>x<\/strong><\/em>. &#8220;run2&#8221; uses <em><strong>x<\/strong><\/em>, as well as a parameter <strong><em>y<\/em><\/strong> obtained from Get_Input_Parameter, to spit out another output <em><strong>z<\/strong><\/em>, so<em><strong> z = <\/strong><strong>z<\/strong><strong>(x,y)<\/strong><\/em>.<\/p>\n<p>I am trying to build a workflow that does something like this:<br \/>1. Call &#8220;run1&#8221; to get <em><strong>x<\/strong><\/em>.<br \/>2. Set a value of <em><strong>y<\/strong><\/em>, call &#8220;run2&#8221; to get <em><strong>z<\/strong><\/em>, save results.<br \/>3. Repeat previous step for different values of <strong><em>y<\/em><\/strong>.<\/p>\n<p>The reason I do not want to combine &#8220;run1&#8221; and &#8220;run2&#8221; into a single define_on_demand macro is because I only need to execute &#8220;run1&#8221; once. If I combine it into a single macro with &#8220;run2&#8221;, then &#8220;run1&#8221; would execute every single time with &#8220;run2&#8221;, which is unnecessary and potentially time-consuming.<\/p>\n<p>Is there a way to do this?<\/p>\n","protected":false},"template":"","class_list":["post-277580","topic","type-topic","status-closed","hentry","topic-tag-udf"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["279402"],"_bbp_author_ip":["96.7.74.173"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["147"],"_edit_lock":["1680500525:211250"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["277580"],"_bbp_forum_id":["27792"],"_bbp_engagement":["279402"],"_bbp_voice_count":["1"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["277584"],"_bbp_last_active_id":["277584"],"_bbp_last_active_time":["2023-04-03 05:33:55"]},"test":"kenneth-funglciconsultants-com-au"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/277580","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\/277580\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=277580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}