Hello, I would like to know how to obtain all the data of all the phases at a specific point, in order to be able to later extract this data in a ".txt" file and be able to generate this type of graph:
This is part of the code that I generated, but I have not been able to obtain what I wanted:
x_i= 0 y_i= medio punto = g_o.addcurvepoint("stress point", (x_i, y_i)) punto.Identification = "Central" g_o.update() g_i.calculate() g_i.view(shear_phase) curvepoints_central = g_o.CurvePoints.StressPoints print(g_o.tabulate(curvepoints_central, "x y")) Epsyyx_o = g_o.getresults(g_o.ResultTypes.Soil.Epsyy, 'stress point') SigyyE_o = g_o.getresults(g_o.ResultTypes.Soil.SigyyE, 'stress point') with open("ey - Sy'" + ".txt", "w") as file: file.writelines(["{}\t{}\n".format("Epsyy", "SigyyE_kPa")]) file.writelines(["{}\t{}\n".format(Epsyy, SigyyE) for Epsyy, SigyyE in zip(Epsyyx_o, SigyyE_o)])
Dear Andres,
You are on the right path. You select a point but then you use the getresults command which returns results for all stress points. Instead, you should use the getcurveresults command.
You can check an example here: https://communities.bentley.com/products/geotech-analysis/w/plaxis-soilvision-wiki/45450/output-scripting-example-create-curve-data
Answer Verified By: Andrés Gavidia
Dear Stefanos Papavasileiou,
Thanks for helping me, this link helped me a lot, but the results are only at the end in the phase, I want results about each step in the phase.Again, I share part of my code (corrected):
x_i= 0 y_i= medio punto = g_o.addcurvepoint("stress point", (x_i, y_i)) punto.Identification = "Central" g_o.update() g_i.calculate() g_i.view(shear_phase) curvepoints_central = g_o.CurvePoints.StressPoints print(g_o.tabulate(curvepoints_central, "x y")) Epsyy_o = [] SigyyE_o = [] for phase in phaseorder: Epsyy_o.append(g_o.getcurveresults(punto, phase, g_o.ResultTypes.Soil.Epsyy)) SigyyE_o.append(g_o.getcurveresults(punto, phase, g_o.ResultTypes.Soil.SigyyE)) with open("ey - Sy'" + ".txt", "w") as file: file.writelines(["{}\t{}\n".format("Epsyy", "SigyyE_kPa")]) file.writelines(["{:.5f}\t{:.2f}\n".format(Epsyy, SigyyE) for Epsyy, SigyyE in zip(Epsyy_o, SigyyE_o)])
Dear Andrés,
The Steps object is part of the Phases object. Therefore you can add an extra loop as follows:
for phase in phaseorder: for step in phase.Steps: # rest of code
Epsyy_o = [] SigyyE_o = [] for phase in phaseorder: for step in phase.Steps: Epsyy_o.append(g_o.getcurveresults(punto, step, g_o.ResultTypes.Soil.Epsyy)) SigyyE_o.append(g_o.getcurveresults(punto, step, g_o.ResultTypes.Soil.SigyyE))
I'm sorry, but tell me:
"AttributeError: Requested attribute 'Steps' is not present"
Hello again,
You should check in your code what is done at each step (basic debugging). From your code, I cannot really tell what does the phaseorder variable contain. This has to have PLAXIS Output phase objects, e.g. g_o.Phase_1, g_o.Phase_2, etc.
In my case it works fine: