Python Script: extrude multiple surfaces to volumes

Hi,

I am trying to use Python script in Plaxis to automate my work and I am stuck with extruding multiple surfaces to volumes:

here is my code:

for i in range(1000):
    g_i.extrude((g_i.Polygon_i), 0, 0, 1)
the error message:
AttributeError: Requested attribute 'Polygon_i' is not present
Please note I need to extrude thousands of surfaces and it will vary based on the different problems. 
Thank you very much for your reply!
Parents
  • Hello Kunyu,

    Indeed Samet's suggestion is how I would do it. The problem is that g_i.Polygon_i is read first by Python and if you check on PLAXIS side the Polygon_i does not exist an an object. I understand of course that you try to say, first Polygon_1, then Polygon_2 with the range function but indeed the other suggestion is better.

    Remember that the g_i.Surfaces behaves as a list, so you can also slice it to handle part of it. So, g_i.Surfaces[2:10] will consider the third object up to the 10th object in g_i.Surfaces listable.

    Answer Verified By: Kunyu Yang 

Reply
  • Hello Kunyu,

    Indeed Samet's suggestion is how I would do it. The problem is that g_i.Polygon_i is read first by Python and if you check on PLAXIS side the Polygon_i does not exist an an object. I understand of course that you try to say, first Polygon_1, then Polygon_2 with the range function but indeed the other suggestion is better.

    Remember that the g_i.Surfaces behaves as a list, so you can also slice it to handle part of it. So, g_i.Surfaces[2:10] will consider the third object up to the 10th object in g_i.Surfaces listable.

    Answer Verified By: Kunyu Yang 

Children