Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
PLAXIS | SOILVISION
  • Product Communities
  • More
PLAXIS | SOILVISION
PLAXIS | SOILVISION Wiki Adding functionality to PLAXIS Calculation Manager: pre- and post-processing
    • Sign in
    • -Geotechnical Analysis Wiki
      • +Geotechnical SELECT Entitlements [GSE]
      • -PLAXIS
        • +Software and License - PLAXIS
        • +Documentation - PLAXIS
        • -API / Python scripting - PLAXIS
          • Access to Staged Construction settings using Python
          • Adding functionality to PLAXIS Calculation Manager: pre- and post-processing
          • Automatic line cross-section chart generation using Python
          • Automatically generated cross-sections of embankments
          • Changing the material colour using Python scripting
          • Combined plate results in one chart using Python
          • Create custom connection with selection API
          • Export and format plots from PLAXIS Output using Python
          • How to create a tunnel using Python
          • How to get a load - displacement curve using Scripting interface
          • How to install additional Python modules in PLAXIS
          • How to open and close a PLAXIS project with Python
          • How to retrieve results from PLAXIS Output by the node number
          • Identify Python commands from Plaxis command line
          • Material lists in PLAXIS – Python
          • Material Property changes for Python scripting
          • Output scripting example: create curve data
          • Output scripting example: get anchor force
          • Output scripting example: get heave of excavation bottom
          • Output scripting example: get maximum bending moment
          • Polycurves to Polygons in PLAXIS 2D using Python
          • Receive instant notifications for finished calculations on your phone
          • Remove invalid custom connections for PLAXIS 3D
          • Retrieve coordinates of a Polygon in PLAXIS 2D using Python
          • Retrieving soil layer info from boreholes using Python
          • Scripting reference and how to use it
          • Selection API for PLAXIS Input
          • Soil layer material assignment using Python
          • Tunnel advancement script for PLAXIS 3D
          • User defined Python script (3D): Extract displacements by coordinates
        • +Known issues - PLAXIS
        • +Models - PLAXIS
        • +Tips and Tricks
        • +Publications
        • +Videos - PLAXIS
      • +PLAXIS LE
      • +PLAXIS Monopile Designer
      • +SOILVISION
      • +Subscription Entitlement Service
    • +Working from home with PLAXIS
    • +Working from home with PLAXIS LE

     
     Questions about this article, topic, or product? Click here. 

    Adding functionality to PLAXIS Calculation Manager: pre- and post-processing

    Application PLAXIS 2D
    PLAXIS 3D
    Version PLAXIS 2D CONNECT Edition V20 Update 3
    PLAXIS 3D CONNECT Edition V20 Update 3
    Date created 15 December 2020
    Date modified 15 December 2020

    General

    The Calculation manager tool has been introduced for running multiple PLAXIS 2D and/or PLAXIS 3D projects unattended. An overview of the tool is provided here.

    When using the Calculation manager tool, it is possible to include one pre-processing and/or one post-processing Python script. The pre-processing python script will be executed before running each project listed in the Calculation Manager’s window, while the post-processing will be executed after running each project, but before saving it.

    Structure of the script

    The structure of the post-processing script should be the following:

    # Import any modules, functions that might be needed for your script
    # BOILERPLATE PLAXIS #
    from plxscripting.easy import *
    # END BOILERPLATE
    
    
    # function for post-processing should have the following signature 
    def run_postcalc(project, s_i, g_i):
        """
        :param s_i: server object of Plaxis application in Input
        :param g_i: global object of current open Plaxis model in Input
        :param project: (str) full project path + name
        """
        # type your code here to perform any actions
        # e.g.: open Output program and establish connection to the server 
        output_port = g_i.view(g_i.CurrentPhase)
        s_o, g_o = new_server('localhost', output_port, password=s_i.connection._password)
    
        # close Output program
        g_o.close()
    

    The pre-processing script should have a similar structure. Although having the same arguments, the name of the function of the pre-processing script should be:

    def run_precalc(project, s_i, g_i):
    

    Note that the pre-processing script will be invoked after opening a given project from staged construction mode. The script should leave the project in staged construction mode. To ensure this, the selected mode of Staged construction should be called at the end of the script: 

    g_i.gotostages()
    

    Location of the script within PLAXIS distribution

    The pre-processing script should be named “multicalc_precalc.py”, while the post-processing script should be named “multicalc_postcalc.py”. In both cases, the Python scripts should be placed inside the folder termed “MultiCalc” included in the “Tools” subfolder of the PLAXIS installation folder, located by default in:

    C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V20\tools\MultiCalc

    Note: administrator rights are needed to add or create files in this folder.

    Example

    A video illustrating the use of this feature can be found below. In this video, the Calculation Manager is launched from PLAXIS 2D and two different projects are selected for calculation. A post-processing Python script is used to get the maximum total displacement obtained for the last phase of each project and the coordinates of the node at which it occurs.

    Click here to play this video

    Outputting information while running the script

    Particularly during the time that the pre- and/or post-script is being developed, it is advised to run the Calculation Manager tool using the Command Prompt for outputting. With such a purpose, the following steps can be taken:

    1) Open either PLAXIS 2D or PLAXIS 3D;

    2) Select option Python > Command prompt from Expert menu;

    3) Start remote scripting server section;

    3) Execute runner.pyw, located in the MultiCalc distribution by typing: “python tools\MultiCalc\runner.pyw”.

    The calculation manager will open. Any action performed in Calculation manager (e.g. adding a project to the list) will be reported in the Command Prompt window. Furthermore, as illustrated below, any print statement included in the script will be displayed in the Command Prompt window, which may be help understanding where a given script may fail.

    Figure 1. Using Command Prompt for outputting information while running a script.

    See also

    • Calculation manager for PLAXIS 2D and PLAXIS 3D
    • Using PLAXIS Remote scripting with the Python wrapper

    • calculation manager
    • output
    • PLAXIS 3D
    • python
    • API
    • py cookbook
    • Automation
    • Scripting
    • PLAXIS
    • Remote scripting
    • python cookbook
    • PLAXIS 2D
    • Share
    • History
    • More
    • Cancel
    • Stefanos Papavasileiou Created by Bentley Colleague Stefanos Papavasileiou
    • When: Tue, Dec 15 2020 8:21 AM
    • Stefanos Papavasileiou Last revision by Bentley Colleague Stefanos Papavasileiou
    • When: Tue, Feb 15 2022 6:11 AM
    • Revisions: 4
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2021 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies