Ansys Products

Ansys Products

Discuss installation & licensing of our Ansys Teaching and Research products.

[Ansys Rocky] How do I open the other project in Python Shell or Prepost Script?

    • yanahiro0214
      Subscriber

      I want to open another project in prepost scripts for automatic calibrations.

      To build Prepost Scripts, I need to see how the API works with Python Shell.

      Here are two photos describing my situation. 

      When I try to open another file from one project file, I get a popup saying “Do you want to save the current project?".  This stops the execution of my script.

      pj1 is the initial project file. I am trying to open pj from pj2.

      app.OpenProject(ini) worked correctly after I put "Yes" on the popup. I also did the “project.SaveProject()” command and a popup appeared.

       

      How can I solve this problem?

      -Is there a script to disable popup or select "Yes"?
      -Or is there a way to force a file to open from a script?

      I have looked in the API documentation, but I have not found anything about app.OpenProject() or a command to open another file.

       

       

      If anyone knows how to do this, please respond.

       

       

    • Jackson Gomes
      Ansys Employee

      Hi Hiroki Yanagawa.

      You need to save your project before execute the script to determine the path of the PrjectFilename, or you can determine the path using .SaveProject('PATH')

      You can find more information about prepost scripting on HELP MENU | MANUALS | Prepost Scripting manual. You can also download and debug some Ready to use scripts, accessing HELP MENU|READY-TO-USE-SCRIPTS| Download scripts.

      Best Regards

    • yanahiro0214
      Subscriber

      Dear Jackson Gomes,

      Thank you very much for your guidance. Your instructions helped me resolve the issue. I appreciate your prompt and detailed response.

      Best regards,

      Hiroki Yanagawa

       

       

       

      • Jackson Gomes
        Ansys Employee

        Hello Hiroki,

        I'm very glad to hear that my instructions helped you resolve the issue. Thank you for your feedback.

        Best regards,

Viewing 2 reply threads
  • The topic ‘[Ansys Rocky] How do I open the other project in Python Shell or Prepost Script?’ is closed to new replies.