If i run the command from python it gives the following command and error message:
set (Terreinbelasting_Spoordijk_I Terreinbelasting_Spoordijk_II_talud Terreinbelasting_Spoordijk_III) F04_GGT_Realisatie_Bypass_Oost 30Invalid parameters. Make sure that the specified parameters match the ones that are expected.
However, when i add an underscore infront of the command and paste it in the command window in Plaxis it works.
_set (Terreinbelasting_Spoordijk_X_1.qy_start Terreinbelasting_Spoordijk_XI_1.qy_start Terreinbelasting_CB_Oost_2.qy_start) F04_GGT_Realisatie_Bypass_Oost -30
Does this mean it's not possible to set multiple elements at the same time from the API?
Hello Niels,
The underscore does not affect the command when used in front of PLAXIS commands.
The two commands are different. Notice that in the second case, the Terreinbelasting_Spoordijk_I is actually Terreinbelasting_Spoordijk_X_1.qy_start.This means that you are accessing the property .qy_start and not the main object called Terreinbelasting_Spoordijk_I.
Therefore, it is possible to set multiple elements as you have correctly done via the GUI and/or the second command, but you need to target the property that will be set to the value of -30 (in phase F04_GGT_Realisatie_Bypass_Oost, if I am guessing correctly by the name).
Hi Stefanos, i think you are correct. But how does it work through the Python API? the command is usually g_i.set(object, phase, value). However, i would like to set the same value and phase for multiple objects. Currently Plaxis loops over all the individual elements, which can be time consuming.
Hi Niels,
I am not entirely sure what you mean. If you need to set the same value on multiple, yet specific objects how else would you consider applying it?
Note that you could potentially make a group of objects and apply the change here, but still, it is setting a value that corresponds to a single property of a single object.
Can you elaborate a bit more?
By the way, this is the equivalent command in Python:
g_i.set(g_i.Terreinbelasting_Spoordijk_X_1.qy_start, g_i.Terreinbelasting_Spoordijk_XI_1.qy_start, g_i.Terreinbelasting_CB_Oost_2.qy_start, g_i.F04_GGT_Realisatie_Bypass_Oost, -30)
Sorry again for the late replay Stefanos, this is exactly what i meant. I am going to try if i can run this in a dynamic way tomorrow, will put my solution here as well on how i got it to work.