Combined plate results in one chart using Python


 

Application PLAXIS 2D
Version PLAXIS 2D CONNECT Edition V21 and later
PLAXIS 2D 2023.1 and later
Date created 30 May 2017
Date modified 29 October 2024

A Python script combining forces and displacements for a single wall into a plot and table

Introduction

In order to retrieve and document results for retaining walls (vertical plates) in PLAXIS 2D Output, several plots and tables need to be inspected and copied separately. For instance:

When copying this data for many phases, this can be a lot of work, and is prone to human error, e.g. by taking the wrong phase or by forgetting to press Ctrl+C when inspecting a table.

Python solution

By using the Remote Scripting Server in the Plaxis Output program, we can create a Python script to automatically retrieve the desired displacements and forces for a certain vertical plate. The attached script will ask the user to define the X-coordinate for the vertical plate and to define for which phase the results should be obtained.

The Python script will then:

Script output - table

The resulting table will be copied to the clipboard to be used in e.g. a spreadsheet program. It will contain a header with info on the phase the results are for and for which X-coordinate the results are taken, followed by the actual data table. The data is stored as tab-separated values.

Based on the final phase of Tutorial Lesson 2, this table will look like this:

PLAXIS 2D Result script: Plate results
For phase: Third excavation stage [Phase_5]
Step number: Step_24
Vertical plate at X = 50.0 m

X    Y      u_x                  u_y                   |u|                 N                      Q                    M                      rotation
[m]  [m]    [m]                  [m]                   [m]                 [kN/m]                 [kN/m]               [kNm/m]                [°]
50   20     0.0224266240723166   -0.00775284541048889  0.0237288870206748  -0.000503572077390047   0.0171521096654468   2.87346535454702e-13  0.480217532450464
50   19.75  0.0245219323623862   -0.00775279974664634  0.0257183022514521  -2.76566870972096      -1.16857362594199    -0.114778674602701     0.480218001424812
50   19.5   0.0266170992800733   -0.00775265919316243  0.0277231617722547  -5.69441776254759      -3.73654034658163    -0.699885794686862     0.480223070463705
50   19.25  0.028712053956832    -0.00775241824433458  0.029740242619305   -8.79201320755032      -7.67343619438683    -2.09749667300932      0.480241927766234
50   19     0.0308067771926515   -0.00775207114821604  0.031767154862919   -12.0637175217222      -12.965949311491     -4.64903832929917      0.480288664180428
[...]

Script output - plot

The Python script will define a matplotlib-chart with one vertical axis for the plate and three horizontal axes: u_x, N and M. This chart is based on the parasites example from Matplotlib.

Based on the final phase of Tutorial Lesson 2, this chart will look like this:

Python generated plot showing combined results for displacements and forces

Figure 1. Python generated plot showing combined results for displacements and forces for Tutorial Lesson 2's final phase.

Note: this Python script will directly use the data from the PLAXIS Output program. The only exception is for the horizontal displacement ux: when the SI unit for length [m] is used, the deformation values for the curve data are converted to [mm] to improve the reading of the generated graph.

Modules used

The Python script requires the following modules:

All modules are part of the standard PLAXIS 2D 2017 installation that includes a full Python 3.4.x distribution.

Usage instructions for Python script

To use this file:

  1. Download the file (use Save As...)
  2. Unpack the zip file and copy the *.py file to this folder:
    <PLAXIS 2D installation folder>\pytools\output
    By default, the installation folder for PLAXIS 2D is:
    C:\Program Files\Seequent\
    For older versions, this is:
    C:\Program Files\Bentley\Geotechnical\
  3. Restart PLAXIS 2D Output and open a Plaxis file with an activated retaining wall (vertical plate)
  4. In the Expert menu, go to Python > Run script > Tools. Here you should see the name of the Python file. When selecting it, it will execute the script to retrieve the results for the plate:
    •  As a table in the Windows clipboard
    •  Followed by generation of the chart

When you do not have access rights to add the script in this folder, alternatively, you can choose to use Expert menu > Python > Run script > Open... to manually open and run the file.

Version

The current version of the script is V1.3.
This script has been made for PLAXIS 2D 2017.00 using Python 3.4.x (see v1.1)
The script has been tested with PLAXIS 2D CONNECT Edition V20, V21, PLAXIS 2D 2023.2 (see v1.2) and PLAXIS 2D 2024.1 (see v1.3).

Disclaimer

This Python script is made available as a service to PLAXIS users and can only be used in combination with a Bentley Geotechnical SELECT Entitlement [GSE] (former PLAXIS-VIP) license.
You use this Python script at your own responsibility and you are solely responsible for its results and the use thereof. Plaxis does not accept any responsibility nor liability for the use of this Python script nor do we provide support on its use.

Downloads