Quantcast
Channel: PLAXIS - Knowledge Base - Tips and Tricks
Viewing all articles
Browse latest Browse all 25

Output scripting example: get anchor force

$
0
0
Application:

In this example, we will use Tutorial Lesson 3 (Tied back excavation) [link] for the Plaxis file. In this case, we want to determine the force in the top anchor that is connected on the left retaining wall. This anchor is activated in Phase_3, and is connected with the wall at X = 40 m and Y = 27 m .

In order to retrieve this anchor force, we will use Output’s Remote Scripting environment with the Python wrapper:

  • we will need to launch the Output scripting server, available via the Expert menu
  • and we should make sure the Plaxis results are opened in the Output program
  • then we will obtain the anchor force for each phase in which the anchor is active. Since the ground anchor is activated in Phase_3, we can use all phases starting from this phase ( g_out.Phases[3:] )
  • for each phase we will obtain the anchor results: coordinates X and Y, and the anchor force N.
  • from which we will filter out node that belongs to the top anchor of the left retaining wall (at X= 40.0, Y = 27 m). We can identify an anchor by one of its endpoints. Because the order of the nodes is the same in each of these getresults-lists, we can use the X and Y coordinates to filter out the correct anchor force.
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_out, g_out = new_server('localhost', localhostport_output)


#geometric data for correct anchor:
Xanchor = 40.0
Yanchor = 27.0

#start from Phase_3 since the anchors are not active before this phasefor phase in g_out.Phases[3:]:
    anchorForce = g_out.getresults(phase,
                                   g_out.NodeToNodeAnchor.AnchorForce2D,
                                   'node')
    anchorX = g_out.getresults(phase, 
                               g_out.NodeToNodeAnchor.X,
                               'node')
    anchorY = g_out.getresults(phase,
                               g_out.NodeToNodeAnchor.Y,
                               'node')

    for x,y,N inzip(anchorX,anchorY,anchorForce):
        if x == Xanchor and y == Yanchor:
            print("Anchor force N in {}: {:.2f} kN/m".format(phase.Name,N))

The result from Python would look similar to this:

  Response from Python in IDLE >>>Anchor force N in Phase_3: 500.00 kN/m
Anchor force N in Phase_4: 544.09 kN/m
Anchor force N in Phase_5: 468.03 kN/m
Anchor force N in Phase_6: 460.27 kN/m>>>

Viewing all articles
Browse latest Browse all 25

Trending Articles