Hello Stefanos Papavasileiou I'd like to know whether I can change values at a bunch of surfaceloads for different phases using a loop. this code doesn't get any error but no results also, can you help please ?
Thank you
Correction:
but still not working
and the table if it helps
Hello Zakaria,
As we are the PLAXIS forum I will focus mainly on the PLAXIS side and let you sort out the best way to do this with your Python script.
Based on what I read, I assume that seeing no results means that the PLAXIS command line has no commands executed either. That might be the case as I see that in your last line, the PLAXIS Python command is within quotation marks (' ') making it a string.
Instead, the command has to pass directly to the scripting layer and especially the PLAXIS object itself. Via the .format() this comes as a string making it different to target the PLAXIS object SurfaceLoad_19 or the string 'SurfaceLoad_19'. I hope that this is clear now.
So, a way to achieve that is to use the getattr() function that PLAXIS offers. With this function, you provide a string, and you get the PLAXIS object. An example is:
srfload = 'SurfaceLoad_1_1'
surface_load_obj = getattr(g_i, srfload)
surface_load_obj.sigz[g_i.Phases[-1]] = -10
The above code should do the trick in helping you pass text as a string to PLAXIS objects and then be able to access them as commands.
That means that your last command should not be a string, otherwise, PLAXIS will not execute anything.
Answer Verified By: Zakaria ZIRI