Integrate PLAXIS models in parametric engineering tools with Python

VIKTOR

by VIKTOR

VIKTOR has developed an integration with PLAXIS software as one of its digital building blocks, in which models can be designed, analyzed, and data results can be exported from PLAXIS quick and easy in the Cloud using Python. By automating the generation of models and integrating the analysis and visualizing of results within one single app, a significant increase in efficiency is achieved for geotechnical engineering.
Download the white paper and get INSPIRED

Learn how collaborative parametric design models allow you to work together for better solutions.

Let’s start automating geotechnical engineering!

PLAXIS is a well-known and widely used software package that executes finite element analyses (FEA) in the field of geotechnical engineering, such as waterflow, deformation and stability. Due to its easy set-up, geotechnical engineers who are new to the PLAXIS software package will only need a couple hours of training to be able to work with the geotechnical design and analysis software.

Create a PLAXIS model with a few lines of Python code

PLAXIS software supports an API that follows commands from within Python. This means that users can easily optimize their workflow with Python. It requires a Bentley Geotechnical SELECT Entitlement license to be fully functional. For each action in PLAXIS (e.g. adding materials) a matching Python command can be tracked down. This enables engineers to find out which commands they can use to design models and read out their data. PLAXIS software also supports addition of Python software packages

Running the analysis in the VIKTOR web application

In order for PLAXIS to direct a VIKTOR application, the following is needed:

  • A VIKTOR application
  • A worker
  • A server where PLAXIS software is installed with the correct license for analysis

From the VIKTOR application, the Python script is sent to the server via the worker. The worker is a general worker that can carry out executables (e.g. programs, commands) to the server of a customer. In this case the Python script will be activated. After analysis, the generic worker sends back specific files to the application, which can subsequently process the results (e.g. visualizing, generating downloads etc.)

The script that is being sent to the worker, consists of the following parts:

  • Start-up of the PLAXIS remote scripting service
  • The code to direct, build and read results from the PLAXIS model
  • Creation of output files that have to be written off into the working directory of the worker – these will be send back to the app once the process finishes Starting up the remote scripting service looks as follows:
1import subprocess, time, os 2PLAXIS_PATH = r"C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V20\\Plaxis2DXInput.exe" # Specify PLAXIS path. 3PORT = 10000 # Define a port number. 4PASSWORD = 'secret' # Define a password. 5subprocess.Popen([PLAXIS_PATH, f'--AppServerPassword={PASSWORD}', f'--AppServerPort={PORT}']) # Start the PLAXIS remote scripting service. 6time.sleep(30) # Wait for PLAXIS to boot before sending commands to the scripting service. 7# Start the scripting server. 8global g_i, s_i 9s_i, g_i = new_server('localhost', PORT, password=PASSWORD) 10# Execute code. 11# Extract required data and write files to working directory.

The output files can have a substantial file size. Therefore only the relevant information is being taken out of and sent back to the app, instead of the complete output files. A clever tip is to store the output files on the server so they can always be inspected later by a geotechnical engineer.

Below, an example is shown of a parametric design application in which sheet piles are analyzed with PLAXIS software. This application is developed by Nathalie Bouwman, Guido Bongers and Johan van Ede who are engineers at VolkerWessels.

After reading in the CPTs, a layer structure is automatically generated with associated material sets for the different soil types. In here, ground water levels and hydraulic head can be adjusted.

The construction, loads and phasing can be quickly entered and adjusted. The automated output shows the forces and deformations of the retaining element, with its anchors and props.

In case the starting points change, existing calculations can be easily recalculated at the push of a button.

Let’s talk software integration!

Would you like to know how we can support you with integrating PLAXIS or any other software package? Feel free to contact us! See how you build your own Cloud-based parametric design tools for automation and optimization.

CTA_Find_Out_More

Share

Related Blog Posts

5 powerful Python libraries every Structural Engineer should know

Read more

6 Ways to improve your SAP2000 and ETABS workflows

Read more

How to use Python to automate SAP2000

Read more