


{"id":169633,"date":"2022-05-20T09:25:40","date_gmt":"2022-05-20T09:25:40","guid":{"rendered":"\/forum\/forums\/topic\/automatically-run-a-python-script-when-starting-mechanical\/"},"modified":"2022-05-31T14:23:21","modified_gmt":"2022-05-31T14:23:21","slug":"automatically-run-a-python-script-when-starting-mechanical","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/automatically-run-a-python-script-when-starting-mechanical\/","title":{"rendered":"Automatically run a Python script when starting Mechanical"},"content":{"rendered":"<p>Hello<br \/>\ni wrote a Python script which basically imports a views.xml file and loads different model views from this file. This script already works fine but i would like to run it automatically each time a Mechanical Session is launched.<br \/>\nI don&#8217;t want to use the &#8220;Connect\/Run Python Code Objects When Mechanical is Launched&#8221;, because the solution is being deleted when adding a Python Script to the Model Tree. <br \/>\nACT would be an option, but i did not find a proper function to automatically call the function.<br \/>\nIs there any way to automatically run a python script when a mechanical is started?<br \/>\nThanks in advance!<\/p>\n","protected":false},"template":"","class_list":["post-169633","topic","type-topic","status-closed","hentry","topic-tag-act","topic-tag-automatisation-1","topic-tag-mechanical","topic-tag-python","topic-tag-scripting"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_btv_view_count":["1377"],"_bbp_likes_count":["0"],"_bbp_subscription":["256363"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["169633"],"_bbp_forum_id":["27791"],"_bbp_engagement":["200","256363"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["215165"],"_bbp_last_active_id":["215165"],"_bbp_last_active_time":["2022-05-31 14:23:21"]},"test":"fabian-maierpoettinger-at"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/169633","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\/169633\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=169633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}