| Application | PLAXIS 2D PLAXIS 3D |
| Version | PLAXIS 2D all versions PLAXIS 3D all versions |
| Date created | 25 March 2026 |
| Date modified | 25 March 2026 |
| Original author | Stefanos Papavasileiou - Technical Support Group |
| Keywords | PLAXIS, Python, start, launch, Input, Output, subprocess, module, API |
Automating your geotechnical analyses with PLAXIS can significantly speed up your workflow, especially for parametric studies or complex projects.
This article shows how to use a Python script and the subprocess module to launch and control PLAXIS without opening the application manually.
The main scope of this article is to explain how to use Python's subprocess module to start the PLAXIS application as a separate process in Windows OS.
Once PLAXIS is running, you can connect to Input or Output using the plxscripting library to send commands, build models, run calculations, and extract results.
The Python script is divided into several parts, from launching the application to closing it down cleanly.
The full Python script is provided as a compressed file (ZIP) at the end of this article. Below each part is explained in detail, so you can adjust it according to your preferences.
As always at the beginning of a Python script it is advisable to add any general import operations. In the article we need to import the subprocess module (official Python documentation).
Before we start, it is important to define some key constants.
| Variable | Description |
|---|---|
| plx_input_path | The full path to the Plaxis2DXInput.exe or Plaxis3DInput.exe on your machine. Make sure this is correct for your installation. |
| plx_input_port | The port number for the API server. This can typically be any free port; 10000 is the default value. |
| plx_password | The password for the server. You must replace 'YOUR_PASSWORD' with the secure password in PLAXIS. This password can be the same as the one in the ‘Configure remote scripting server’ window under Expert menu, from Input or Output. |
This is where we use the subprocess.Popen function to start the PLAXIS Input application. Here, we pass the aforementioned variables as arguments. Notice the command arguments required:
Once PLAXIS is running, we need to establish a connection to the scripting server. This is done with the new_server function from the plxscripting.easy module.
This is the core of your automation script. Here, you can script all the actions you would normally perform manually in the PLAXIS UI.
To analyse the results, you need to launch and connect to the PLAXIS Output program.
With the connection to the Output program established, you can now add commands to extract results, create plots, or generate cross sections.
It is crucial to close the server sessions properly to release the PLAXIS license.
Finally, plx.terminate() sends a command to the operating system to close the PLAXIS application that was started by subprocess.Popen function in the beginning. This ensures a clean shutdown of the entire process.