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 Tunnel advancement script for PLAXIS 3D
    • Sign in
    • +Working from home with PLAXIS
    • +Working from home with PLAXIS LE
    • -PLAXIS | SOILVISION Wiki
      • +Geotechnical SELECT Entitlements [GSE]
      • -PLAXIS
        • PLAXIS CONNECT Edition and legacy versions
        • +License - PLAXIS
        • +PLAXIS Software downloads
        • +Release Notes PLAXIS 2D and PLAXIS 3D
        • +Manuals - PLAXIS
        • -API / Python scripting - PLAXIS
          • How to install additional Python modules in PLAXIS
          • Access to Staged Construction settings using Python
          • Automatic line cross-section chart generation using Python
          • Changing the material colour using Python scripting
          • Combined plate results in one chart using Python
          • Create custom connection with selection API
          • How to create a tunnel using Python
          • How to get a load - displacement curve using Scripting interface
          • Identify Python commands from Plaxis command line
          • Material lists in PLAXIS – Python
          • 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
          • 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
          • Adding functionality to PLAXIS Calculation Manager: pre- and post-processing
          • Remove invalid custom connections for PLAXIS 3D
          • Automatically generated cross-sections of embankments
        • +Downloads - PLAXIS
        • +Known issues - PLAXIS
        • +Models - PLAXIS
        • +Publications
        • +Tips and Tricks
        • +Tutorials - PLAXIS
        • +Verifications - PLAXIS
        • +Videos - PLAXIS
      • +PLAXIS LE
      • +PLAXIS Monopile Designer
      • +SOILVISION
      • +Subscription Entitlement Service

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

    Tunnel advancement script for PLAXIS 3D

    Application PLAXIS 3D
    Version PLAXIS 3D
    Date created 13 December 2016
    Date modified 13 December 2016

    With the introduction of the tunnel designer with sequencing options, it is now possible to define a repetitive tunnel construction sequence to model tunnel advancement procedures for the calculation phases.
    When the tunnel needs to be moved one step forward in this sequence in a phase, you need to select the Tunnel from the model explorer, right-click and select the option Advance to next tunnel step:

    tunnel_advancement_script_for_PLAXIS_3D_GIF
    Doing this for many phases is a lot of manual and tedious work, and chances are that in a large tunnel project one could easily miss one step by mistake.
    Using the command line would give you more certainty that all the steps are performed for all the phase.

     

    The command to advance the tunnel one step in its sequence in a phase is:

    advance Tunnel_1 Phase_1

    Commands Runner

    Using the Commands runner, you could specify this easily for a few phases:

    phase Phase_1
    setcurrentphase Phase_2
    advance Tunnel_1 Phase_2
    phase Phase_2
    setcurrentphase Phase_3
    advance Tunnel_1 Phase_3
    phase Phase_3
    setcurrentphase Phase_4
    advance Tunnel_1 Phase_4

    When dealing with a lot more phases, this can be a lot of effort to make it work for all the phases until you reach the final tunnel construction.

    Python solution

    It would be nice if we could just repeat this procedure of tunnel advancement several times. Using the Plaxis Remote Scripting feature and the Python wrapper, we can do this easily by defining a for loop to repeat this tunnel advancement for a predefined number of times.

    advancementsteps = 10
    
    tunnel = g_i.Tunnel_1
    lastphase = g_i.Phase_1
    
    for i in range(advancementsteps):
        lastphase = g_i.phase(lastphase)
        g_i.setcurrentphase(lastphase)
        g_i.advance(tunnel, lastphase)
    

    This can be further extended to also include a nice GUI window (using the easygui module) to fill in the number of steps. Below you can find this Python script file.

    PLAXIS 3D CONNECT Edition V20 - Tunnel advancement script in action

    Usage instructions for Python script

    To use this file:

    • Download the file (use Save As...);
    • Unpack the zip file and copy the tunnel_advancement.py file to this folder:
      <PLAXIS 3D installation folder>\pytools\input
      By default the installation folder for PLAXIS 3D is:
      C:\Program Files\Bentley\Geotechnical\PLAXIS 3D CONNECT Edition V20\
      For older versions, this would be:
      C:\Program Files\Plaxis\Plaxis 3D\
    • Restart PLAXIS 3D and open a Plaxis file with a tunnel with sequencing defined
    • Make sure you are in Staged construction mode
    • In the Expert menu, go to Python > Run script > Tools. Here you should see the name of Python file. When selecting it, it will execute the script to advance your tunnel for the specified number of steps.

    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.

    Downloads

    • [Python script] PLAXIS 3D Tunnel advancement tool

    See also

    How to define an excavation sequence in Tunnel Designer

    [Videos]

    • Plaxis 3D
    • python
    • pytool
    • API
    • NATM tunnel
    • py cookbook
    • App
    • PLAXIS
    • cookbook
    • python cookbook
    • Tunnel
    • tool
    • sequencing
    • pyapp
    • tunnel designer
    • Share
    • History
    • More
    • Cancel
    • Micha van der Sloot Created by Bentley Colleague Micha van der Sloot
    • When: Wed, Dec 18 2019 9:34 AM
    • Stefanos Papavasileiou Last revision by Bentley Colleague Stefanos Papavasileiou
    • When: Tue, Oct 13 2020 6:20 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