{"id":170686,"date":"2023-06-05T07:04:57","date_gmt":"2023-06-05T07:04:57","guid":{"rendered":"\/knowledge\/forums\/topic\/does-mechanical-pass-the-strings-ex-file-name-as-an-input-arguments-into-macros\/"},"modified":"2023-07-31T12:33:34","modified_gmt":"2023-07-31T12:33:34","slug":"does-mechanical-pass-the-strings-ex-file-name-as-an-input-arguments-into-macros","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/does-mechanical-pass-the-strings-ex-file-name-as-an-input-arguments-into-macros\/","title":{"rendered":"Does Mechanical pass the &#8216;Strings&#8217; (Ex. file name) as an Input Arguments into macros?"},"content":{"rendered":"<p>The Mechanical GUI does not support passing strings into macros.  The workaround would be to name the files such that they end with a number such as:  file1,csv file2,csv file3,csv  then pass the number in as arg1.  The macro should be written to use file%arg1%,csv and there cannot be spaces in the path or filename. For example following macro will read data from file1.csv into table HGEN1.  \/INQUIRE,numlines,LINES,&#8217;D:ProjectFEA_1file%arg1%&#8217;,&#8217;csv&#8217; rownum=numlines *dim,HGEN1,table,(rownum-1),(5-1) *tread,HGEN1,&#8217;D:ProjectFEA_1file%arg1%&#8217;,&#8217;csv&#8217;<\/p>\n","protected":false},"template":"","class_list":["post-170686","topic","type-topic","status-publish","hentry","topic-tag-4422","topic-tag-command-objects","topic-tag-macros-scripting","topic-tag-mechanical","topic-tag-structural-mechanical-scripting","topic-tag-structural-mechanics"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_bbp_last_active_time":["2\/6\/2023 20:20"],"_bbp_forum_id":["27789"],"_bbp_author_ip":["209.182.204.162"],"_btv_view_count":["667"],"siebel_km_number":["2048396"],"product_version":["18"],"km_published_date":["2017-02-22T00:00:00.000Z"],"family":["Structural Mechanics"],"application_name":["Mechanical"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/170686","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\/170686\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=170686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}