


{"id":372849,"date":"2024-07-20T14:02:36","date_gmt":"2024-07-20T14:02:36","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/ansys-rocky-how-do-i-open-the-other-project-in-python-shell-or-prepost-script\/"},"modified":"2024-07-20T14:02:36","modified_gmt":"2024-07-20T14:02:36","slug":"ansys-rocky-how-do-i-open-the-other-project-in-python-shell-or-prepost-script","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/ansys-rocky-how-do-i-open-the-other-project-in-python-shell-or-prepost-script\/","title":{"rendered":"[Ansys Rocky] How do I open the other project in Python Shell or Prepost Script?"},"content":{"rendered":"<p>I want to open another project in prepost scripts for automatic calibrations.<\/p>\n<p>To build Prepost Scripts, I need to see how the API works with Python Shell.<\/p>\n<p>Here are two photos describing my situation.&nbsp;<\/p>\n<p>When I try to open another file from one project file, I get a popup saying &ldquo;Do you want to save the current project?&#8221;.&nbsp; This stops the execution of my script.<\/p>\n<p>pj1 is the initial project file. I am trying to open pj from pj2.<\/p>\n<p>app.OpenProject(ini) worked correctly after I put &#8220;Yes&#8221; on the popup.&nbsp;I also did the &ldquo;project.SaveProject()&rdquo; command and a popup appeared.<\/p>\n<p>&nbsp;<\/p>\n<p>How can I solve this problem?<\/p>\n<p>-Is there a script to disable popup or select &#8220;Yes&#8221;?<br \/>-Or is there a way to force a file to open from a script?<\/p>\n<p>I have looked in the API documentation, but I have not found anything about app.OpenProject() or a command to open another file.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>If anyone knows how to do this, please respond.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" title=\"Scripts 1\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2024\/07\/20-07-2024-1721482891-screenshot1.png\" alt=\"\"><\/p>\n<p><span><img decoding=\"async\" title=\"Scripts 2\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2024\/07\/20-07-2024-1721482926-screenshot2.png\" alt=\"\"><\/span><\/p>\n","protected":false},"template":"","class_list":["post-372849","topic","type-topic","status-closed","hentry","topic-tag-ansys","topic-tag-ansys-applications","topic-tag-api","topic-tag-documentation","topic-tag-rocky-dem-1","topic-tag-solver-errors"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["438509","66199"],"_bbp_author_ip":["2400:2411:9941:a300:51f2:e0a1:2569:72d1"]," _bbp_last_reply_id":["0"],"_btv_view_count":["502"]," _bbp_likes_count":["0"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["372849"],"_bbp_forum_id":["27796"],"_bbp_engagement":["66199","438509"],"_bbp_voice_count":["2"],"_bbp_reply_count":["3"],"_bbp_last_reply_id":["373275"],"_bbp_last_active_id":["373275"],"_bbp_last_active_time":["2024-07-23 15:16:06"]},"test":"yanahiro0214gmail-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/372849","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\/372849\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=372849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}