I tried to use 'arrayr' to creat 30*30 cubiods in x-y plane using Python script.
Codes:
soil1 = g_i.cuboid(1, (0.5, 0.5, 0))g_i.arrayr(soil1, 30, (1,0,0), 30, (0,1,0))
Errors:
!!!!> arrayr (Volume_1 Volume_1.Soil) 30 (1 0 0) 30 (0 1 0)Invalid parameters. Make sure that the specified parameters match the ones that are expected.
The scripting reference only contained examples for points.
Dear Yuting Zhang,
The command does not work as you can see that you try to array a volume object (can be arrayed) and its Soil object (cannot be arrayed). So, the command is invalid.I will try to elaborate so that you can understand where it goes wrong and hopefully learn from it.
If you do this via the PLAXIS GUI you will see that the generated command is:arrayr (Volume_1) 30 1 0 0 30 0 1 0
That means that via Python you are passing more arguments in the command than necessary.
This is explained as in your first command, cuboid, you assign everything to a variable called soil1. If you print the contents you will see that it contains both a Volume object and a Soil object as these two are created together in PLAXIS:
So, what you need to do is to do a double assignment or refer to the first item of the list when using one variable.
Option 1:
volume1, soil1 = g_i.cuboid(1, (0.5, 0.5, 0))g_i.arrayr(volume1, 30, (1,0,0), 30, (0,1,0))
Option 2:
cube1 = g_i.cuboid(1, (0.5, 0.5, 0))g_i.arrayr(cube1[0], 30, (1,0,0), 30, (0,1,0))