When using the PLAXIS scripting environment, it is possible to open and close any PLAXIS project using Python.
The following information can be used in both PLAXIS Input and Output applications.
To open a project in PLAXIS Input program, you can use the Python function:
s_i.open('full path to PLAXIS project')
s_o.open('full path to PLAXIS project') # for PLAXIS Output program
in which the <full path> is provided as a string including the PLAXIS file extension (.p2dx or .p3d).
s_o.open(r'C:\PLAXIS projects\2D\myproject.p2dx') # for PLAXIS Output program
Note: above the r means the string will be treated as a raw string and the backslashes used in the project path will not cause any conflicts in the Python language.
To close the current project in the session, you can use the command:
s_o.close() # for PLAXIS Output program
Note that there are no extra parameters to be defined in this case. Remember to always save your progress in PLAXIS Input before closing the project with the command:
In PLAXIS Output a few extra commands are available depending on how the application should behave.
g_o.update() # closes Output and stores the selected curve points
g_o.close() # closes the PLAXIS Output program
The article Using PLAXIS Remote scripting with the Python wrapper contains detailed information about the variables used in the boilerplate.
Using PLAXIS Remote scripting with the Python wrapper [API / Python scripting]
Run multiple calculations easily [Tips and Tricks]
Reference manual - Appendix Python HTTP REST API wrapper [Manuals]