You are currently reviewing an older revision of this page.
In this example, we will use Tutorial Lesson 3 (Tied back excavation) [link] as an example. In this case, we want to determine the maximum heave of the excavation bottom. In the final phase, Phase_6, the bottom of the excavation is located at Y = 20.0 m, with the left retaining wall at X = 40 m and the right retaining wall at X = 60 m.
In order to retrieve the maximum heave for this excavation bottom, we will use Output’s Remote Scripting environment with the Python wrapper:
Below is an example code how to achieve this.
localhostport_output = 10001 plaxis_path = r'C:\Program Files (x86)\Plaxis\PLAXIS 2D' # no trailing backslash! import imp found_module = imp.find_module('plxscripting', [plaxis_path]) plxscripting = imp.load_module('plxscripting', *found_module) from plxscripting.easy import * s_o, g_o = new_server('localhost', localhostport_output) # geometric limits for the bottom of the excavation: x_left = 40.0 x_right = 60.0 y_bottom = 20.0 # initialize defaults maxUy = 0.0 xAtMaxUy = 0.0 yAtMaxUy = 0.0 # obtain result tables from Output: soilX = g_o.getresults(g_o.Phase_6, g_o.ResultTypes.Soil.X, 'node') soilY = g_o.getresults(g_o.Phase_6, g_o.ResultTypes.Soil.Y, 'node') soilUy = g_o.getresults(g_o.Phase_6, g_o.ResultTypes.Soil.Uy, 'node') # determine maximum heave for x, y, uy in zip(soilX, soilY, soilUy): if x_left < x < x_right: if abs(y - y_bottom) < 1E-5: if uy > maxUy: maxUy = uy xAtMaxUy = x yAtMaxUy = y print("Maximum heave of excavation bottom: uy={:.3f} m " "at (X,Y)=({:.2f},{:.2f})".format(maxUy, xAtMaxUy, yAtMaxUy))
The result from Python would look like this:
Response from Python in IDLE >>> Maximum heave of excavation bottom: uy=0.050 m at (X,Y)=(50.00,20.00) >>>
Output scripting example: create curve data
[Python Scripts]
Output scripting example: get anchor force
Output scripting example: get maximum bending moment
Identify Python commands from Plaxis command line
Using PLAXIS Remote scripting with the Python wrapper
[Tips and Tricks]