I'm used to model PLAXIS using remote scripting, but has encountered a problem when scripting a linear elastic soil material. I get an error when I input the following, in that order: MaterialName, SoilModel, DrainageType, gammaUnsat, gammaSat, Eref, nu, Gref, Eoed, Vs, Vp, Rinter. The generated soil does not register the stiffnesses. Is there a property too much or a property too less?
Dear Lasse,
Nice that you are trying to automate processes with PLAXIS!
What exactly is the problem? Do you have an error? Can you share a screenshot of your code and the error?
Which version are you using?
Hi Stefanos,
Thank you for returning to me. Automation is indeed great.
The issue is that when i use the python scripting to import soils (Issue has only been with Linear Elastic Material model), PLAXIS generates a SoilMat and registers the name and unitweights, after that, there is some problems with the stiffnesses, and it does not apply the stiffness to the soil. My code stops, shows an error, and the automation is not possible before this is somehow fixed. Below I have put my code from Python, which is here just the function i use for import of soils:
def soilPropertiesMA(s_i, g_i, soil):
for i in soil:
Eref = int(i.E) nu = i.nu Eoed = round(((1-nu)*Eref)/((1-2*nu)*(1+nu))) Gref = round(Eref/(2*(1+nu))) gamma_sat = i.gammaSat gamma_unsat = i.gammaUnsat rho = gamma_unsat/9.8 Vs = mt.sqrt(Gref/rho) Vp = mt.sqrt(Eoed/rho) material = g_i.soilmat() material.setproperties( "MaterialName", i.soilName, # "DefaultValuesAdvanced", True, "SoilModel", i.soilModel, "DrainageType", i.drainageType, "gammaUnsat", gamma_unsat, "gammaSat", gamma_sat, "Eref", Eref, "nu", nu, "Gref", Gref, "Eoed", Eoed, "Vs", Vs, "Vp", Vp, # "Einc", 0, "Rinter", i.Rinter)
And here is the error from Python:
PlxScriptingError: Internal Server Erroroperating system : Windows 10 x64 build 19044program up time : 6 secondsprocessors : 12x Intel(R) Core(TM) i7-10850H CPU @ 2.70GHzphysical memory : 52973/65255 MB (free/total)free disk space : (C:) 785,20 GBexecutable : Plaxis3DInput.exeversion : 21.1.0.479exception class : EInvalidCastexception message : Invalid class typecast.
And in PLAXIS I get the following message:
!!!!> setproperties SoilMat_1 "MaterialName" "Fill" "SoilModel" "1" "DrainageType" "Drained" "gammaUnsat" 16.0 "gammaSat" 16.0 "Eref" 7428 "nu" 0.3 "Gref" 2857 "Eoed" 9999 "Vs" 41.83195548859747 "Vp" 78.25846599569915 "Rinter" 0.667
So it seems it is registering something right, but then stops for some reason. I hope you are able to help me out. :)
Even though I was missing a couple of variables (e.g., drainageType) I managed to run the command without an issue.
I did notice two things that is incorrect for V22 (which is the version I assumed you work with).
So, the following worked fine in my case (notice that I replaced the variables with values I thought were right (to run the script):
import math Eref = int(1e6) nu = 0.3 Eoed = round(((1-nu)*Eref)/((1-2*nu)*(1+nu))) Gref = round(Eref/(2*(1+nu))) gamma_sat = 18 gamma_unsat = 20 rho = gamma_unsat/9.8 Vs = math.sqrt(Gref/rho) Vp = math.sqrt(Eoed/rho) material = g_i.soilmat() material.setproperties( "Identification", "test", # "DefaultValuesAdvanced", True, "SoilModel", "Mohr-Coulomb", "DrainageType", "Drained", "gammaUnsat", gamma_unsat, "gammaSat", gamma_sat, "Eref", Eref, "nu", nu, "Gref", Gref, "Eoed", Eoed, "Vs", Vs, "Vp", Vp, # "Einc", 0, "InterfaceStrengthDetermination", "Manual", "Rinter", 0.9)
Hi Again,
Thanks a lot for your time.
I'm sitting with version V21, so the Identification is stil MaterialName, but very good to know once I'm upgrading. :)
I tried again using your tips with e.g. "InterfaceStrengthDetermination", "Manual". However, the code did still not run properly.
I figured that I could have been something about the number format of the stiffness input, I think there were too many decimals and also some of the input names had a space in them. So when rounding down to 1 decimal and using _ instead of the name, the code started running.
Luckily this is now resolved, thank you a lot for your attention and your help with the issue.
Alright! Glad I could help.
Indeed knowing the exact version being used helps identify version-specific issues.