Output reading Plaxis 3D embedded beams with Python

Dear all,

This is my first time asking a question here, but I have trouble creating a output script for my files to automate the reading of several of the resultant forces. The output is now made with the following script (see below). The problem is directly in the first line, getting a self._getattr(attr_name) error with Resultypes not existing. Is it possible to help me with that?

from plxscripting.easy import *
s_o, g_o = new_server('localhost', 10002, password='Password')

from openpyxl import Workbook
import os
import re
phases_read_out = ["F2_Load"]
path= "C:\\Users\\921913\\Documents\\Master thesis\\Plaxis model\\New model 30-3-30\\Complex group\\"
for file in os.listdir(path):
    match=re.search(".p3d",file)
    if match:
        s_o.open(path+file)
        Phases = g_o.Phases
        Phase_names = g_o.Phases.Name.value
        print(Phase_names)
        phase_count = 0
        for phase in Phase_names:
            print(phase)
            Piles = g_o.EmbeddedBeams
            pile_count = 0
            if str(phase) == phases_read_out[0]:
                for Pile in Piles:
                    Pile_X = g_o.getresults(g_o.Piles[pile_count],Phases[phase_count], g_o.ResultTypes.EmbeddedBeam.X,"node")
                    Pile_Y = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count], g_o.ResultTypes.EmbeddedBeam.Y,"node")
                    Pile_Z = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count], g_o.ResultTypes.EmbeddedBeam.Z,"node")
                    Pile_N = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count], g_o.ResultTypes.EmbeddedBeam.N,"node")
                    Pile_Q12 = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count],g_o.ResultTypes.EmbeddedBeam.Q12, "node")
                    Pile_Q13 = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count],g_o.ResultTypes.EmbeddedBeam.Q13, "node")
                    Pile_M1 = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count],g_o.ResultTypes.EmbeddedBeam.M1, "node")
                    Pile_M2 = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count],g_o.ResultTypes.EmbeddedBeam.M2, "node")
                    Pile_M3 = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count],g_o.ResultTypes.EmbeddedBeam.M3, "node")
                    Pile_Ux = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count],g_o.ResultTypes.EmbeddedBeam.Ux, "node")
                    Pile_Uy = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count],g_o.ResultTypes.EmbeddedBeam.Uy, "node")
                    Pile_Uz = g_o.getresults(g_o.Piles[pile_count], Phases[phase_count],g_o.ResultTypes.EmbeddedBeam.Uz, "node")
                    print("results for " + str(Piles[pile_count].Name.value))
                    print(Pile_X[0], Pile_Y[0], Pile_Z[0], )
                    print(Pile_N[:])
                    print(Pile_Uz[:])
                    pile_count = pile_count + 1
                    pile_count = pile_count + 1
            phase_count = phase_count + 1
            print("phase count = " + str(phase_count))

  • Dear Daan,

    Welcome to the Forum! I am happy to see more and more people trying to automate processes with Python and PLAXIS.
    Typically in posts, it really helps to mention the version that you are working with and which tool you use to run it (SciTE or other IDE). That can make a difference especially when we have to test something before we provide an answer. For this question, I am going to assume you use PLAXIS 3D CONNECT Edition V22 Update 1 as this is our latest version available.

    You mention that you have an error with the ResultTypes not existing. I have copied your code and try to run it in my case for Tutorial 2 (no piles, yet embeddedbeams) and it worked fine:

    So it is not clear to me what exactly is going wrong. Maybe you can double-check that you are using the correct PLAXIS Python Distribution for the right version. These by default for the CONNECT Edition are stored at (do not pick the internal one): C:\ProgramData\Bentley\Geotechnical

    If the error persists, please submit a service request to assist you in detail: https://apps.bentley.com/srmanager/ProductSupport

  • Thank you Stefanos,

    Unfortunately I explained it incorrectly, the fist line that gives an error is the line where getresults starts. It is impossible for the program to read the output for some reason, as the ResultTypes gives the stated error. I do you the latest version, but don't know the difference between SciTE or IDE. The progam can indeed correctly find the stages, and print the names (as a control point), but after the real 'reading phase' the errors come up

  • Dear Daan, 

    The first check I do is always to run the same command but in the PLAXIS command line. Does that work?

    SciTE is a code editor. PyCharm and Spyder are some IDEs (Integrated Development Environment) which you may be using to run the code. The screenshot above is from PyCharm.

    If you still cannot figure it out, please submit a service request to assist you in detail: https://apps.bentley.com/srmanager/ProductSupport