Hello,
I'm trying to write a python script that will extract stress and displacement results from all nodes on a single chosen interface, but am having some trouble with getting results for the interface element, i've tried variations on the code below, but get the error as shown:
Code:
stress_results = g_o.getresults(phase,g_o.ResultTypes.Interface.InterfaceTotalNormalStress,'node')
(also not working: g_o.getresults(interface,phase,g_o.ResultTypes.Interface.InterfaceTotalNormalStress,'node') ((the structure of which works fine for extracting beam / embedded beam results)
Error (in PLAXIS):
!!!!> getresults 8 ResultTypes.Interface.InterfaceTotalNormalStress "node"Invalid parameters. Make sure that the specified parameters match the ones that are expected.
I know the above (when working) will get me node results for every interface in the model. Would there be a way to instruct it to only extract results from an interface with a certain reference?
As always, any help would be very much appreciated!
Kind regards
Maddie
Dear Maggie,
Have you checked our documentation? You can find it under Help>Command reference>Output commands>getresults.
You can find a couple of alternatives (examples) of the syntax of the command that includes any object, e.g., embedded beam or in your case, interface.
The same for scripting as you are writing a Python script. You can find it under Help>Scripting reference>Output>getresults.
The one thing I notice in your case is that even though the structure of the command is correct, apparently the variable "interface" is pointing to a number (=8). So the error message is actually correct, something in your specified parameters is not as expected.Therefore, I think that somewhere in your script that variable is defined and it should have been, for example, g_o.PositiveInterface_8_1 and not it is just 8.
If you correct that part in your script then the command should work, which you can verify by running it first in the PLAXIS command line (use the PLAXIS syntax) or via the Interpreter (with Python):
getresults PositiveInterface_8_1 ResultTypes.Interface.InterfaceTotalNormalStress "node" # for example
interface = g_o.PositiveInterface_8_1 # for examplephase = g_o.Phases[-1] # for exampleg_o.getresults(interface, phase, g_o.ResultTypes.Interface.InterfaceTotalNormalStress, 'node')
Answer Verified By: maddie groves
Hello Stefanos Papavasileiou Is there a way to get all the positive interfaces ? g_o.Interfaces works, but i'm looking for something like g_o.PositiveInterfacesThank you
Dear Zakaria,
There is no distinction between positive or negative interfaces in PLAXIS. They are all Interfaces for the results and the calculation kernel. The distinction is when it comes to determining the side for visualisation purposes.
I would advise you instead of trying to get the results per Interface object so you can filter them based on the names which include the word Positive, instead.
Thanks you Stefanos. I thought of filtering by name but I couldn't get the name for each interface. It works when I call results for one Interface (PositiveInterface_1 for example) but when I call all the interfaces, I get "Interfaces". Do you have a suggestion ?
Hello again,
I meant that you should loop over all Interfaces.
This means that you would have first PositiveInterface_1_1, PositiveInterface_1_2 and so on and then NegativeInterface_1_1, NegativeInterface_1_2 and so on. There you can do your filtering.
That would be the first parameter of the getresults command as noted in the examples of the Command Reference, too.
Okay I understand. I've been avoiding this but I see that I have no choice. Thank you Stefanos, have a good day.