What is the PLAXIS API?
The PLAXIS API (Remote Scripting) allows you to drive PLAXIS 2D/3D using Python instead of only using the graphical interface. You send commands from a script, PLAXIS builds the model, runs the calculation and returns the results.
In practice, PLAXIS acts as a calculation engine and your Python script becomes the "controller" that defines geometry, soil materials, structural elements, phases and output.
Fundamental Principle of Using the PLAXIS API
When you use the API, you are not changing the constitutive models or the solver. You are simply replacing mouse clicks with Python commands. The main ideas are:
- PLAXIS runs with the Remote Scripting Server enabled.
-
A Python script connects to PLAXIS using the
plxscriptingwrapper and creates a session. - The script sends commands to the Input side (geometry, materials, phases) and reads results from the Output side (stresses, displacements, curves).
Core Objects
| Object | Role | Typical Use |
|---|---|---|
s_i |
Server input session | Connection to PLAXIS Input (model building) |
g_i |
Global Input object | Set project data, geometry, soil/structural materials, loads, phases, mesh |
s_o |
Server output session | Connection to PLAXIS Output (post-processing) |
g_o |
Global Output object | Access stresses, strains, displacements, curves and cross-sections |
Typical API Workflow
- Start PLAXIS Input/Output and enable the Remote Scripting Server.
- Connect from Python using
new_server("localhost", port, password). - Create or modify the model using
g_i(soil contour, boreholes, materials, structures, phases). - Generate the mesh and run calculations from the script.
- Use
g_oto read results and export tables or plots.
Benefits of Using the PLAXIS API
Using the PLAXIS API is especially helpful when you need to repeat similar analyses, explore many design options or link PLAXIS to other tools (spreadsheets, web apps, optimisation or AI workflows).
Why Use the API?
| Aspect | Only GUI | With API (Python) |
|---|---|---|
| Repeatability | Manual steps, easy to miss a setting. | Same script, same model every time; fully documented. |
| Parametric studies | Change parameters by hand case by case. | Loop over many values automatically and collect results. |
| Speed | Time-consuming for similar projects. | One command can build, run and export multiple cases. |
| Integration | PLAXIS used in isolation. | PLAXIS can be coupled with spreadsheets, web forms, optimisation or ML models. |
| Quality & audit | Harder to reconstruct exactly what was done. | The script is a complete, version-controlled record of all inputs, phases and changes. |
Example Use Cases
- Automated footing or embankment models for multiple projects.
- Pile group or retaining wall parametric studies.
- Generating design charts (e.g. settlement vs stiffness or load).
- Back-analysis and calibration using optimisation or machine learning.
- Building a simple web interface where users submit geometry and soil data, and the backend runs PLAXIS via the API.
What Knowledge Do You Need?
You do not need to be a software engineer to use the PLAXIS API effectively. The key ingredients are:
- Comfort with PLAXIS modelling in the GUI (soils, structures, phases, output).
- Basic Python: variables, lists, loops, simple functions and running scripts/notebooks.
-
A basic understanding of the PLAXIS object model:
g_i.Soils,g_i.Plates,g_i.LineLoads,g_i.Phases, and corresponding output objects.
The tutorials in the navigation bar build on this overview and demonstrate concrete examples: creating models, assigning materials, applying loads and extracting results using the PLAXIS API.