{"id":164814,"date":"2023-03-17T08:58:44","date_gmt":"2023-03-17T08:58:44","guid":{"rendered":"\/knowledge\/forums\/topic\/how-can-i-use-an-external-text-file-in-icem-script\/"},"modified":"2023-07-31T12:26:19","modified_gmt":"2023-07-31T12:26:19","slug":"how-can-i-use-an-external-text-file-in-icem-script","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/how-can-i-use-an-external-text-file-in-icem-script\/","title":{"rendered":"How can I use an external text file in ICEM script?"},"content":{"rendered":"<p>In the replay file use the following lines set inputfile [open &#8220;input.txt&#8221;] set lineNumber 0 gets $inputfile comp1 gets $inputfile comp2 close $inputfile ic_mess &#8220;comp1: $comp1  n&#8221; red ic_mess &#8220;comp2: $comp2  n&#8221; red  These will open the file input.txt, read the two first lines and place the value in the variables of comp1 and comp2, respectively. To refer to the variables in the script use: $comp1 and $comp2. The latter two lines will print the value in the message window.  The lines in input.txt should be: 30 15<\/p>\n","protected":false},"template":"","class_list":["post-164814","topic","type-topic","status-publish","hentry","topic-tag-17-2","topic-tag-fluid-dynamics","topic-tag-general","topic-tag-hexa","topic-tag-icem-cfd"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_bbp_last_active_time":["3-15-2023  20:20:18"],"_bbp_forum_id":["27796"],"_bbp_author_ip":["23.56.168.180"],"_btv_view_count":["424"],"siebel_km_number":["459242"],"product_version":["17.2"],"km_published_date":["2005-12-08T00:00:00.000Z"],"family":["Fluid Dynamics"],"application_name":["ICEM CFD"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/164814","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\/164814\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=164814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}